diff options
author | mathieui <mathieui@mathieui.net> | 2016-06-11 13:47:49 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2016-06-11 13:47:49 +0200 |
commit | 7072b8f6355cabeb633ed38d6ab147bb2c359a51 (patch) | |
tree | af6f16f610401260e3675523ef07329d32c58f0b /src | |
parent | 2225d13ad16ef4bfa0c72d1313b09499a8518c65 (diff) | |
download | poezio-7072b8f6355cabeb633ed38d6ab147bb2c359a51.tar.gz poezio-7072b8f6355cabeb633ed38d6ab147bb2c359a51.tar.bz2 poezio-7072b8f6355cabeb633ed38d6ab147bb2c359a51.tar.xz poezio-7072b8f6355cabeb633ed38d6ab147bb2c359a51.zip |
Fix a refresh bug
On xmltab and listtab, the help text would be displayed in the input
after closing the tab.
Diffstat (limited to 'src')
-rw-r--r-- | src/tabs/basetabs.py | 2 | ||||
-rw-r--r-- | src/tabs/listtab.py | 2 | ||||
-rw-r--r-- | src/tabs/xmltab.py | 7 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/tabs/basetabs.py b/src/tabs/basetabs.py index ca8dafae..bb0c0ea4 100644 --- a/src/tabs/basetabs.py +++ b/src/tabs/basetabs.py @@ -90,6 +90,7 @@ class Tab(object): if not hasattr(self, 'name'): self.name = self.__class__.__name__ self.input = None + self.closed = False self._state = 'normal' self._prev_state = None @@ -404,6 +405,7 @@ class Tab(object): """ if self.input: self.input.on_delete() + self.closed = True def matching_names(self): """ diff --git a/src/tabs/listtab.py b/src/tabs/listtab.py index 7021c8e3..4d8bab9c 100644 --- a/src/tabs/listtab.py +++ b/src/tabs/listtab.py @@ -141,6 +141,8 @@ class ListTab(Tab): @refresh_wrapper.always def reset_help_message(self, _=None): + if self.closed: + return True curses.curs_set(0) self.input = self.default_help_message self.input.resize(1, self.width, self.height-1, 0) diff --git a/src/tabs/xmltab.py b/src/tabs/xmltab.py index 24187605..b063ad35 100644 --- a/src/tabs/xmltab.py +++ b/src/tabs/xmltab.py @@ -20,7 +20,7 @@ from . import Tab import text_buffer import windows from xhtml import clean_text -from decorators import command_args_parser +from decorators import command_args_parser, refresh_wrapper from common import safeJID @@ -256,12 +256,13 @@ class XMLTab(Tab): self.input.resize(1, self.width, self.height-1, 0) self.input.do_command("/") # we add the slash + @refresh_wrapper.always def reset_help_message(self, _=None): + if self.closed: + return True if self.core.current_tab() is self: curses.curs_set(0) self.input = self.default_help_message - self.input.refresh() - self.core.doupdate() return True def on_scroll_up(self): |