diff --git a/babi/hl/lint_errors.py b/babi/hl/lint_errors.py index f6f9ce0e..28dc2399 100644 --- a/babi/hl/lint_errors.py +++ b/babi/hl/lint_errors.py @@ -252,6 +252,9 @@ def focus(self, screen: Screen) -> None: ch = screen.get_char() if ch.keyname == b'KEY_RESIZE': screen.resize() + elif ch.keyname == b'RETHEME': + screen.retheme() + screen.draw() elif ch.keyname in {b'^C', b'^X'}: self.set_errors(()) screen.resize() diff --git a/babi/prompt.py b/babi/prompt.py index a9ede916..4d980d12 100644 --- a/babi/prompt.py +++ b/babi/prompt.py @@ -98,6 +98,10 @@ def _cut_to_end(self) -> None: def _resize(self) -> None: self._screen.resize() + def _retheme(self) -> None: + self._screen.retheme() + self._screen.draw() + def _check_failed(self, idx: int, s: str) -> tuple[bool, int]: failed = False for search_idx in range(idx, -1, -1): @@ -165,6 +169,7 @@ def _submit(self) -> str: b'KEY_DC': _delete, b'^K': _cut_to_end, # misc + b'RETHEME': _retheme, b'KEY_RESIZE': _resize, b'^R': _reverse_search, b'^M': _submit, diff --git a/babi/screen.py b/babi/screen.py index c00f5179..e496fa6a 100644 --- a/babi/screen.py +++ b/babi/screen.py @@ -386,6 +386,9 @@ def _write(s: str, *, attr: int = curses.A_REVERSE) -> None: key = self.get_char() if key.keyname == b'KEY_RESIZE': self.resize() + elif key.keyname == b'RETHEME': + self.retheme() + self.draw() elif key.keyname == b'^C': return self.status.cancelled() elif isinstance(key.wch, str) and key.wch.lower() in opts: