|
7 | 7 |
|
8 | 8 | next_search = False |
9 | 9 |
|
| 10 | +# MODES |
| 11 | +# 0: default (jumps in front of the selection) |
| 12 | +# 1: select |
| 13 | +# 2: add-cursor |
| 14 | +# 3: jump-after |
10 | 15 | mode = 0 |
11 | 16 |
|
12 | 17 | ace_jump_active = False |
@@ -95,6 +100,7 @@ def run(self, current_buffer_only = False): |
95 | 100 | "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" |
96 | 101 | ) |
97 | 102 | self.case_sensitivity = settings.get("search_case_sensitivity", True) |
| 103 | + self.jump_behind_last = settings.get("jump_behind_last_characters", False) |
98 | 104 |
|
99 | 105 | self.view_settings = settings.get("view_settings", []) |
100 | 106 | self.view_values = get_views_settings( |
@@ -203,7 +209,6 @@ def remove_labels(self): |
203 | 209 |
|
204 | 210 | def jump(self, index): |
205 | 211 | """Performs the jump action""" |
206 | | - |
207 | 212 | if self.target == "" or index < 0 or index >= last_index: |
208 | 213 | return |
209 | 214 |
|
@@ -267,6 +272,15 @@ def after_jump(self, view): |
267 | 272 | view.run_command("move", {"by": "characters", "forward": True}) |
268 | 273 | mode = 0 |
269 | 274 |
|
| 275 | + def jump(self, index): |
| 276 | + global mode |
| 277 | + |
| 278 | + view = self.changed_views[self.view_for_index(index)] |
| 279 | + if self.jump_behind_last and "\n" in view.substr(hints[index].end()): |
| 280 | + mode = 3 |
| 281 | + |
| 282 | + return AceJumpCommand.jump(self, index) |
| 283 | + |
270 | 284 | class AceJumpLineCommand(AceJumpCommand): |
271 | 285 | """Specialized command for line-mode""" |
272 | 286 |
|
@@ -310,7 +324,6 @@ def run(self): |
310 | 324 | global mode |
311 | 325 |
|
312 | 326 | mode = 0 if mode == 3 else 3 |
313 | | - print(mode) |
314 | 327 |
|
315 | 328 | class AddAceJumpLabelsCommand(sublime_plugin.TextCommand): |
316 | 329 | """Command for adding labels to the views""" |
@@ -370,6 +383,7 @@ class PerformAceJumpCommand(sublime_plugin.TextCommand): |
370 | 383 | """Command performing the jump""" |
371 | 384 |
|
372 | 385 | def run(self, edit, target): |
| 386 | + global mode |
373 | 387 | if mode == 0 or mode == 3: |
374 | 388 | self.view.sel().clear() |
375 | 389 |
|
|
0 commit comments