Skip to content
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

Keyboard navigation/shortest path/dot file url open/multi-file support #8

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
jump to prev highlighted item by F2 key added
  • Loading branch information
RHOsanghoon committed Apr 22, 2014
commit 5cb884e6d68113a6f70947b7319c8f13626bceb7
2 changes: 2 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ Command Line
Escape halt animation
Ctrl-drag zoom in/out
Shift-drag zooms an area
F2 prev highlighted item
F3 next highlighted item

If no input file is given then it will read the dot graph from the standard input.

Expand Down
17 changes: 17 additions & 0 deletions xdot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1742,12 +1742,27 @@ def on_key_press_event(self, widget, event):
if event.keyval == gtk.keysyms.p:
self.on_print()
return True
if event.keyval == gtk.keysyms.F2:
# drnol: jump to next highlighted item
self.jump_to_prev_highlight()
return True
if event.keyval == gtk.keysyms.F3:
# drnol: jump to next highlighted item
self.jump_to_next_highlight()
return True
return False

# drnol: jump to prev highlighted item
def jump_to_prev_highlight(self):
if self.highlight:
if len(self.highlight) > 0:
if self.focused == None:
self.focused = 0
else:
self.focused = (self.focused+1) % len(self.highlight)
item = self.highlight[len(self.highlight)-self.focused-1]
self.animate_to(item.x, item.y)

# drnol: jump to next highlighted item
def jump_to_next_highlight(self):
if self.highlight:
Expand Down Expand Up @@ -2111,6 +2126,8 @@ def main():
Escape halt animation
Ctrl-drag zoom in/out
Shift-drag zooms an area
F2 next highlighted item
F3 next highlighted item
'''
)
parser.add_option(
Expand Down