Remove unused code
This commit is contained in:
parent
e4b643fdaf
commit
97b4256ba4
@ -12,7 +12,7 @@ from gettext import gettext as _
|
||||
|
||||
from kitty.cli import parse_args
|
||||
from kitty.key_encoding import ESCAPE, backspace_key, enter_key
|
||||
from kitty.utils import command_for_open, read_with_timeout
|
||||
from kitty.utils import command_for_open
|
||||
|
||||
from ..tui.handler import Handler
|
||||
from ..tui.loop import Loop
|
||||
@ -143,21 +143,6 @@ class URLHints(Handler):
|
||||
self.write(self.current_text)
|
||||
|
||||
|
||||
def read_from_stdin():
|
||||
buf = []
|
||||
|
||||
def more_needed(data):
|
||||
idx = data.find(b'\x1c')
|
||||
if idx == -1:
|
||||
buf.append(data)
|
||||
return True
|
||||
buf.append(data[:idx])
|
||||
return False
|
||||
|
||||
read_with_timeout(more_needed)
|
||||
return b''.join(buf).decode('utf-8')
|
||||
|
||||
|
||||
def regex_finditer(pat, line):
|
||||
for m in pat.finditer(line):
|
||||
s, e = m.span()
|
||||
|
||||
@ -407,9 +407,9 @@ class Boss:
|
||||
if '--program' not in cmdline:
|
||||
args.extend(('--program', self.opts.open_url_with))
|
||||
if type_of_input in ('text', 'history'):
|
||||
data = ((w.buffer_as_text if type_of_input == 'history' else w.as_text)() + '\x1c').encode('utf-8')
|
||||
data = (w.buffer_as_text if type_of_input == 'history' else w.as_text)().encode('utf-8')
|
||||
elif type_of_input in ('ansi', 'ansi-history'):
|
||||
data = ((w.buffer_as_ansi() if type_of_input == 'ansi-history' else w.as_text(as_ansi=True)) + '\x1c').encode('utf-8')
|
||||
data = (w.buffer_as_ansi() if type_of_input == 'ansi-history' else w.as_text(as_ansi=True)).encode('utf-8')
|
||||
elif type_of_input == 'none':
|
||||
data = None
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user