Skip to content

Commit 25e1d42

Browse files
Use on_invalidate callback from Application.
1 parent 6bdc5ef commit 25e1d42

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pymux/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from prompt_toolkit.key_binding.vi_state import InputMode, ViState
1414
from prompt_toolkit.layout.screen import Size
1515
from prompt_toolkit.terminal.vt100_output import Vt100_Output, _get_size
16+
from prompt_toolkit.utils import Callback
1617

1718
from .arrangement import Arrangement, Pane, Window
1819
from .commands.commands import handle_command, call_command_handler
@@ -379,7 +380,8 @@ def on_focus_changed():
379380
mouse_support=Condition(lambda cli: self.enable_mouse_support),
380381
use_alternate_screen=True,
381382
style=self.style,
382-
get_title=get_title)
383+
get_title=get_title,
384+
on_invalidate=Callback(lambda cli: self.invalidate()))
383385

384386
cli = CommandLineInterface(
385387
application=application,
@@ -423,8 +425,6 @@ def key_pressed():
423425
# change size, so everything has to be redrawn.)
424426
self.invalidate()
425427

426-
cli.on_invalidate += lambda: self.invalidate()
427-
428428
# Handle start-up comands.
429429
# (Does initial key bindings.)
430430
if not self._startup_done:

0 commit comments

Comments
 (0)