Skip to content

Commit

Permalink
Add prev/next modification commands to the context menu
Browse files Browse the repository at this point in the history
This is for visibility only as it shows the keyboard shortcut.

Fixes #3
  • Loading branch information
kaste committed Mar 1, 2024
1 parent 64f1943 commit 0edccac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Context.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
{ "caption": "Compare with...", "command": "sbs_compare" },
{ "caption": "Mark selection for comparison", "command": "sbs_mark_sel" },
{ "caption": "Compare selection", "command": "sbs_compare", "args": { "compare_selections": true } },
{ "caption": "Previous modification", "command": "sbs_prev_diff" },
{ "caption": "Next modification", "command": "sbs_next_diff" },
{ "caption": "-" }
]
]
6 changes: 6 additions & 0 deletions sbs_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,10 +665,16 @@ def sbs_scroll_to( view, prev=False ):
view.window().show_quick_panel( [ msg ], None )

class sbs_prev_diff( sublime_plugin.TextCommand ):
def is_visible(self):
return self.view.settings().get("is_sbs_compare", False)

def run( self, edit, string='' ):
sbs_scroll_to( self.view, prev=True )

class sbs_next_diff( sublime_plugin.TextCommand ):
def is_visible(self):
return self.view.settings().get("is_sbs_compare", False)

def run( self, edit, string='' ):
sbs_scroll_to( self.view )

Expand Down

0 comments on commit 0edccac

Please sign in to comment.