Commit afadc39a authored by Bram Schoenmakers's avatar Bram Schoenmakers

Implement '0' and '$' shortcuts to move to first/last column.

parent 466e5793
...@@ -94,6 +94,13 @@ class UIApplication(CLIApplicationBase): ...@@ -94,6 +94,13 @@ class UIApplication(CLIApplicationBase):
def _blur_commandline(self): def _blur_commandline(self):
self.mainwindow.focus_item = 0 self.mainwindow.focus_item = 0
def _focus_first_column(self):
self.columns.focus_position = 0
def _focus_last_column(self):
end_pos = len(self.columns.contents) - 1
self.columns.focus_position = end_pos
def _focus_next_column(self): def _focus_next_column(self):
size = len(self.columns.contents) size = len(self.columns.contents)
if self.columns.focus_position < size -1: if self.columns.focus_position < size -1:
...@@ -106,6 +113,8 @@ class UIApplication(CLIApplicationBase): ...@@ -106,6 +113,8 @@ class UIApplication(CLIApplicationBase):
def _handle_input(self, p_input): def _handle_input(self, p_input):
dispatch = { dispatch = {
':': self._focus_commandline, ':': self._focus_commandline,
'0': self._focus_first_column,
'$': self._focus_last_column,
'left': self._focus_previous_column, 'left': self._focus_previous_column,
'h': self._focus_previous_column, 'h': self._focus_previous_column,
'right': self._focus_next_column, 'right': self._focus_next_column,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment