summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-02-16 00:04:59 +0100
committermathieui <mathieui@mathieui.net>2012-02-16 00:04:59 +0100
commit8478641ad0bdeebea7d79422e3174243b4508a91 (patch)
treeca482bd4c30c0a5a80832f00d4b772367bfb8f17 /src/tabs.py
parentc7da566f0ae6fa412341f48f27122ed7f968ae9d (diff)
downloadpoezio-8478641ad0bdeebea7d79422e3174243b4508a91.tar.gz
poezio-8478641ad0bdeebea7d79422e3174243b4508a91.tar.bz2
poezio-8478641ad0bdeebea7d79422e3174243b4508a91.tar.xz
poezio-8478641ad0bdeebea7d79422e3174243b4508a91.zip
Add shortcuts to browse the history one line at a time
(C-b / C-f)
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py46
1 files changed, 26 insertions, 20 deletions
diff --git a/src/tabs.py b/src/tabs.py
index 492a4412..f9032b6e 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -302,13 +302,25 @@ class Tab(object):
def on_scroll_down(self):
"""
- Defines what happens when we scrol down
+ Defines what happens when we scroll down
"""
pass
def on_scroll_up(self):
"""
- Defines what happens when we scrol down
+ Defines what happens when we scroll up
+ """
+ pass
+
+ def on_line_up(self):
+ """
+ Defines what happens when we scroll one line up
+ """
+ pass
+
+ def on_line_down(self):
+ """
+ Defines what happens when we scroll one line up
"""
pass
@@ -505,6 +517,18 @@ class ChatTab(Tab):
def command_say(self, line):
raise NotImplementedError
+ def on_line_up(self):
+ self.text_win.scroll_up(1)
+
+ def on_line_down(self):
+ self.text_win.scroll_down(1)
+
+ def on_scroll_up(self):
+ self.text_win.scroll_up(self.text_win.height-1)
+
+ def on_scroll_down(self):
+ self.text_win.scroll_down(self.text_win.height-1)
+
class MucTab(ChatTab):
"""
@@ -1055,12 +1079,6 @@ class MucTab(ChatTab):
if self.joined and config.get_by_tabname('send_chat_states', 'true', self.general_jid, True) == 'true' and not self.input.get_text():
self.send_chat_state('active')
- def on_scroll_up(self):
- self.text_win.scroll_up(self.text_win.height-1)
-
- def on_scroll_down(self):
- self.text_win.scroll_down(self.text_win.height-1)
-
def on_info_win_size_changed(self):
if self.core.information_win_size >= self.height-3:
return
@@ -1555,12 +1573,6 @@ class PrivateTab(ChatTab):
if tab and tab.joined and config.get_by_tabname('send_chat_states', 'true', self.general_jid, True) == 'true' and not self.input.get_text():
self.send_chat_state('active')
- def on_scroll_up(self):
- self.text_win.scroll_up(self.text_win.height-1)
-
- def on_scroll_down(self):
- self.text_win.scroll_down(self.text_win.height-1)
-
def on_info_win_size_changed(self):
if self.core.information_win_size >= self.height-3:
return
@@ -2340,12 +2352,6 @@ class ConversationTab(ChatTab):
if resource:
self.send_chat_state('active')
- def on_scroll_up(self):
- self.text_win.scroll_up(self.text_win.height-1)
-
- def on_scroll_down(self):
- self.text_win.scroll_down(self.text_win.height-1)
-
def on_info_win_size_changed(self):
if self.core.information_win_size >= self.height-3:
return