Skip to content

Commit

Permalink
Don't use numbers for command keys. Fixes #153.
Browse files Browse the repository at this point in the history
Remove '0' for BOL and change numeric sort to '#'/'@'
  • Loading branch information
firecat53 committed Nov 13, 2017
1 parent 8ba5a98 commit 6cd917f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.rst
Expand Up @@ -113,7 +113,7 @@ Keybindings:
**F1 or ?** Show this list of keybindings
**Cursor keys or h,j,k,l** Move the highlighted cell, scrolling if required.
**Q or q** Quit
**Home, 0, ^, Ctrl-a** Move to the start of this line
**Home, ^, Ctrl-a** Move to the start of this line
**End, $, Ctrl-e** Move to the end of this line
**[num]|** Goto column <num>, or first column
if num not given
Expand All @@ -137,8 +137,8 @@ Keybindings:
**S** Sort the table by the current column (descending)
**a** 'Natural Sort' the table (ascending)
**A** 'Natural Sort' the table (descending)
**1** Sort numerically by the current column (ascending)
**!** Sort numerically by the current column (descending)
**#** Sort numerically by the current column (ascending)
**@** Sort numerically by the current column (descending)
**r** Reload file/data. Also resets sort order
**y** Yank cell contents to the clipboard
(requires xsel or xclip)
Expand Down
5 changes: 2 additions & 3 deletions tabview/tabview.py
Expand Up @@ -679,7 +679,6 @@ def define_keys(self):
'Q': self.quit,
'$': self.line_end,
'^': self.line_home,
'0': self.line_home,
'g': self.home,
'G': self.goto_row,
'|': self.goto_col,
Expand All @@ -696,8 +695,8 @@ def define_keys(self):
'.': self.column_width_up,
'a': self.sort_by_column_natural,
'A': self.sort_by_column_natural_reverse,
'1': self.sort_by_column_numeric,
'!': self.sort_by_column_numeric_reverse,
'#': self.sort_by_column_numeric,
'@': self.sort_by_column_numeric_reverse,
's': self.sort_by_column,
'S': self.sort_by_column_reverse,
'y': self.yank_cell,
Expand Down
2 changes: 1 addition & 1 deletion test/test_tabview.py
Expand Up @@ -107,7 +107,7 @@ def main(self, stdscr, *args, **kwargs):
v.display()
for key in v.keys:
if key not in ('q', 'Q', 'r', '?', '/', '\n', 'a', 'A', 's', 'S',
'1', '!', 'y', curses.KEY_F1, curses.KEY_ENTER,
'#', '@', 'y', curses.KEY_F1, curses.KEY_ENTER,
t.KEY_CTRL('g')):
v.keys[key]()
elif key in ('q', 'Q', 'r'):
Expand Down

0 comments on commit 6cd917f

Please sign in to comment.