This commit is contained in:
Kovid Goyal 2020-05-12 22:54:08 +05:30
parent cdd943ded4
commit 5e48ae8bac
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
6 changed files with 14 additions and 14 deletions

View File

@ -326,7 +326,7 @@ def write_remote_control_protocol_docs() -> None: # {{{
p(' ', desc), p()
p(), p()
with open(f'generated/rc.rst', 'w') as f:
with open('generated/rc.rst', 'w') as f:
p = partial(print, file=f)
for name in sorted(all_command_names()):
cmd = command_for_name(name)

View File

@ -287,7 +287,7 @@ def category_test(
p('\tswitch(code) {')
for spec in get_ranges(list(chars)):
write_case(spec, p)
p(f'\t\t\treturn true;')
p('\t\t\treturn true;')
p('\t} // }}}\n')
p('\treturn false;\n}\n')
@ -421,8 +421,8 @@ def gen_names() -> None:
p('}; // }}}\n')
# The trie
p(f'typedef struct {{ uint32_t children_offset; uint32_t match_offset; }} word_trie;\n')
all_trie_nodes: List['TrieNode'] = []
p('typedef struct {{ uint32_t children_offset; uint32_t match_offset; }} word_trie;\n')
all_trie_nodes: List['TrieNode'] = [] # noqa
class TrieNode:

View File

@ -289,9 +289,9 @@ class PrintHelpForSeq:
leading_indent = indent
j = '\n' + (' ' * indent)
lines: List[str] = []
for l in text.splitlines():
if l:
lines.extend(wrap(l, limit=linesz - indent))
for ln in text.splitlines():
if ln:
lines.extend(wrap(ln, limit=linesz - indent))
else:
lines.append('')
a((' ' * leading_indent) + j.join(lines))

View File

@ -60,8 +60,8 @@ def screen_cursor_to_column(c: int) -> None:
write(CSI + '%dG' % c)
def screen_cursor_to_line(l: int) -> None:
write(CSI + '%dd' % l)
def screen_cursor_to_line(ln: int) -> None:
write(CSI + '%dd' % ln)
def screen_set_mode(x: int, private: bool) -> None:

View File

@ -624,7 +624,7 @@ class Window:
lines = self.screen.text_for_selection()
if self.opts.strip_trailing_spaces == 'always' or (
self.opts.strip_trailing_spaces == 'smart' and not self.screen.is_rectangle_select()):
return ''.join((l.rstrip() or '\n') for l in lines)
return ''.join((ln.rstrip() or '\n') for ln in lines)
return ''.join(lines)
def call_watchers(self, which: Iterable[Watcher], data: Dict[str, Any]) -> None:

View File

@ -333,10 +333,10 @@ class TestScreen(BaseTest):
s.cursor_position(region + 1, 1), nl()
s.cursor_position(region, 1), s.draw(ch)
s.cursor_position(region, s.columns), s.draw(ch.lower())
for l in range(2, region + 2):
c = chr(ord('I') + l - 2)
before = '\t' if l % 4 == 0 else ' '
self.ae(c + ' ' * (s.columns - 3) + before + c.lower(), str(s.line(l)))
for ln in range(2, region + 2):
c = chr(ord('I') + ln - 2)
before = '\t' if ln % 4 == 0 else ' '
self.ae(c + ' ' * (s.columns - 3) + before + c.lower(), str(s.line(ln)))
s.reset_mode(DECOM)
# Test that moving cursor outside the margins works as expected
s = self.create_screen(10, 10)