diff --git a/docs/conf.py b/docs/conf.py index b4b0dcc2f..fbf03967d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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) diff --git a/gen-wcwidth.py b/gen-wcwidth.py index ec4c67ce3..4a2f6aac9 100755 --- a/gen-wcwidth.py +++ b/gen-wcwidth.py @@ -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: diff --git a/kitty/cli.py b/kitty/cli.py index d0fd273a2..63d8a57c7 100644 --- a/kitty/cli.py +++ b/kitty/cli.py @@ -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)) diff --git a/kitty/client.py b/kitty/client.py index b9cb39665..c05749ef7 100644 --- a/kitty/client.py +++ b/kitty/client.py @@ -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: diff --git a/kitty/window.py b/kitty/window.py index c23c0e43e..372ae5213 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -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: diff --git a/kitty_tests/screen.py b/kitty_tests/screen.py index a3ff5209d..8a6072980 100644 --- a/kitty_tests/screen.py +++ b/kitty_tests/screen.py @@ -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)