From a98cb42cf0e567e9c25dd5c46b3672e632749907 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sat, 25 Feb 2012 02:52:48 +0100 Subject: First of #2336 --- src/tabs.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/tabs.py b/src/tabs.py index 4b8fd58d..78663419 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -2583,6 +2583,7 @@ class XMLTab(Tab): self.core.xml_buffer.add_window(self.text_win) self.default_help_message = windows.HelpText("/ to enter a command") self.commands['close'] = (self.close, _("Usage: /close\nClose: Just close this tab."), None) + self.commands['clear'] = (self.command_clear, _("Usage: /clear\nClear: Clear the content of the current buffer."), None) self.input = self.default_help_message self.key_func['^T'] = self.close self.key_func['^I'] = self.completion @@ -2614,6 +2615,15 @@ class XMLTab(Tab): def on_scroll_down(self): self.text_win.scroll_down(self.text_win.height-1) + def command_clear(self, args): + """ + /clear + """ + self.core.xml_buffer.messages = [] + self.text_win.rebuild_everything(self.core.xml_buffer) + self.refresh() + self.core.doupdate() + def execute_slash_command(self, txt): if txt.startswith('/'): self.input.key_enter() -- cgit v1.2.3