summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-02-25 02:52:48 +0100
committermathieui <mathieui@mathieui.net>2012-02-25 02:52:48 +0100
commita98cb42cf0e567e9c25dd5c46b3672e632749907 (patch)
treeb8b97a21b61930078093079925c12c590a98d1f4 /src
parentb7cbe7d392829a953a73d700ae58c556d68ac74a (diff)
downloadpoezio-a98cb42cf0e567e9c25dd5c46b3672e632749907.tar.gz
poezio-a98cb42cf0e567e9c25dd5c46b3672e632749907.tar.bz2
poezio-a98cb42cf0e567e9c25dd5c46b3672e632749907.tar.xz
poezio-a98cb42cf0e567e9c25dd5c46b3672e632749907.zip
First of #2336
Diffstat (limited to 'src')
-rw-r--r--src/tabs.py10
1 files changed, 10 insertions, 0 deletions
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()