Skip to content

Commit

Permalink
keybindings for next and previous file
Browse files Browse the repository at this point in the history
[ and ] are now keybindings for the next and the previous open file.
  • Loading branch information
stettberger committed Aug 11, 2015
1 parent 55c1d87 commit 8dbba40
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions xdot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2015,6 +2015,8 @@ def __init__(self, command_line_files, widget=None):
# to display a file menu
self.dotwidget.connect("button-press-event", self.on_file_menu)

self.connect('key-press-event', self.on_key_press_event)

self.last_open_dir = "."

self.set_focus(self.dotwidget)
Expand Down Expand Up @@ -2145,12 +2147,12 @@ def on_close_file(self, action):
self.open_file_idx = min(len(self.open_files)-1, self.open_file_idx)
self.open_file(self.open_files[self.open_file_idx])

def on_go_forward(self, action):
def on_go_forward(self, action = None):
"""Display the next file"""
self.open_file_idx = min(self.open_file_idx + 1, len(self.open_files) - 1)
self.open_file(self.open_files[self.open_file_idx])

def on_go_back(self, action):
def on_go_back(self, action = None):
"""Display the previous file"""
self.open_file_idx = max(0, self.open_file_idx - 1)
self.open_file(self.open_files[self.open_file_idx])
Expand Down Expand Up @@ -2195,6 +2197,8 @@ def main():
Up, Down, Left, Right scroll
PageUp, +, = zoom in
PageDown, - zoom out
[ previous open file
] next open file
R reload dot file
F find
Q quit
Expand Down

0 comments on commit 8dbba40

Please sign in to comment.