Skip to content

Commit 909c53b

Browse files
committed
Merge pull request #37 from mreq/master
current_buffer_only option
2 parents c492415 + 5df5547 commit 909c53b

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ You can then override the bindings for any of the following commands:
109109
- ```ace_jump_select```
110110
- ```ace_jump_add_cursor```
111111

112+
The commands accept an optional Boolean `current_buffer_only` argument. When present and set to `true`, AceJump only performs on the currently edited buffer.
113+
112114
### Labels
113115

114116
Go to ```Preferences > Package Settings > AceJump > Settings - User```,

ace_jump.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@
99

1010
mode = 0
1111

12-
def get_active_views(window):
12+
def get_active_views(window, current_buffer_only):
1313
"""Returns all currently visible views"""
1414

1515
views = []
16-
for group in range(window.num_groups()):
17-
views.append(window.active_view_in_group(group))
16+
if current_buffer_only:
17+
views.append(window.active_view())
18+
else:
19+
for group in range(window.num_groups()):
20+
views.append(window.active_view_in_group(group))
1821
return views
1922

2023
def set_views_setting(views, setting, values):
@@ -75,14 +78,14 @@ def clear_views_sel(views):
7578
class AceJumpCommand(sublime_plugin.WindowCommand):
7679
"""Base command class for AceJump plugin"""
7780

78-
def run(self):
81+
def run(self, current_buffer_only = False):
7982
self.char = ""
8083
self.target = ""
8184
self.views = []
8285
self.changed_views = []
8386
self.breakpoints = []
8487

85-
self.all_views = get_active_views(self.window)
88+
self.all_views = get_active_views(self.window, current_buffer_only)
8689
self.syntax = get_views_setting(self.all_views, "syntax")
8790
self.sel = get_views_sel(self.all_views)
8891

0 commit comments

Comments
 (0)