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

Cycling back with shift+enter #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions Default (Linux).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@
{
"keys": ["alt+."],
"command": "ace_jump_after"
},
{
"keys": ["shift+enter"],
"command": "ace_jump_previous"
}
]
4 changes: 4 additions & 0 deletions Default (OSX).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@
{
"keys": ["ctrl+."],
"command": "ace_jump_after"
},
{
"keys": ["shift+enter"],
"command": "ace_jump_previous"
}
]
4 changes: 4 additions & 0 deletions Default (Windows).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@
{
"keys": ["alt+."],
"command": "ace_jump_after"
},
{
"keys": ["shift+enter"],
"command": "ace_jump_previous"
}
]
17 changes: 17 additions & 0 deletions ace_jump.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def run(self, current_buffer_only = False):
ace_jump_active = True

self.char = ""
self.prev= "" #OWN EDIT
self.target = ""
self.views = []
self.changed_views = []
Expand Down Expand Up @@ -426,6 +427,22 @@ def get_target_region(self, region_type):
'current_line': lambda view : view.line(view.sel()[0]),
}.get(region_type)(self.view)

class AceJumpPrevCommand(AceJumpCommand): #OWN EDIT
"""Specialized command for cycling back to previous highlight"""

def init_value(self):
return ""

def regex(self):
return r'\b{}'

def after_jump(self, view):
global mode

if mode == 3:
view.run_command("move", {"by": "word_ends", "forward": True})
mode = 0

class RemoveAceJumpLabelsCommand(sublime_plugin.TextCommand):
"""Command for removing labels from the views"""

Expand Down