Skip to content

Backwards and shift-arrow navigation #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Key bindings
============

Key bindings are listed in HELP window,
you can access it by pressing *h* or *?* key.
you can access it by pressing the *?* key.

{help_string}

Expand Down
4 changes: 4 additions & 0 deletions docs/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Changelog
0.1.4 (unreleased)
------------------

- Added backwards (from init dir) and shift-arrow navigation
[Shaun Marshall]
- Refactor unicode support for lower level functions.
[Matej Cotman]
- Fixed Hydra build error.
Expand All @@ -21,6 +23,8 @@ Changelog
[Matej Cotman]
- Logging to ~/.tarman.log
[Matej Cotman]
- Added view toggle for hidden files/subdirectories
[Shaun Marshall]


0.1.2 (2013-08-13)
Expand Down
10 changes: 4 additions & 6 deletions src/tarman/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def __init__(self, mainscr, stdscr, directory, encoding, show_hiddens):
self.area = None
self.container = FileSystem()
self.directory = self.container.abspath(directory)
self.checked = DirectoryTree(self.directory, self.container)
self.root_directory = '/'
self.checked = DirectoryTree(self.root_directory, self.container)
self.show_hiddens = show_hiddens
self.chdir(self.directory)

Expand Down Expand Up @@ -102,9 +103,6 @@ def chdir(self, newpath):
if newpath is None:
return False

if not newpath.startswith(self.directory):
return False

try:
if self.area is None:
oldsel = 0
Expand Down Expand Up @@ -221,10 +219,10 @@ def loop(self):
elif self.ch == curses.KEY_DOWN:
self.area.set_params(h, offset=1)

elif self.ch == curses.KEY_PPAGE:
elif self.ch in [curses.KEY_PPAGE, curses.KEY_SR]:
self.area.set_params(h, offset=-5)

elif self.ch == curses.KEY_NPAGE:
elif self.ch in [curses.KEY_NPAGE, curses.KEY_SF]:
self.area.set_params(h, offset=5)

elif self.ch == 32:
Expand Down