Skip to content

Commit 03c0d17

Browse files
author
deathaxe
committed
Drop JumpBack command
Obsolete as of ST3. Key bindings are re-mapped to built-in `jump_prev`. Mouse binding is dropped as conflicting with built-in block selection binding.
1 parent 2d1347f commit 03c0d17

File tree

5 files changed

+9
-65
lines changed

5 files changed

+9
-65
lines changed

Context.sublime-menu

-5
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,5 @@
66
"caption": "Navigate to Definition",
77
"command": "navigate_to_definition",
88
"args": {}
9-
},
10-
{
11-
"caption": "Jump Back",
12-
"command": "jump_prev",
13-
"args": {}
149
}
1510
]

Default.sublime-keymap

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
"keys": ["ctrl+t", "ctrl+y"]
1313
},
1414
{
15-
"command": "jump_prev",
15+
"command": "jump_back",
1616
"keys": ["ctrl+t", "ctrl+b"]
1717
},
1818
{
19-
"command": "jump_prev",
19+
"command": "jump_back",
2020
"keys": ["ctrl+shift+comma"]
2121
},
2222
{

Default.sublime-mousemap

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"modifiers": ["ctrl", "shift"],
77
"command": "navigate_to_definition"
88
},
9-
{
10-
"button": "button2",
11-
"count": 1,
12-
"modifiers": ["ctrl", "shift"],
13-
"command": "jump_prev"
14-
}
9+
// {
10+
// "button": "button2",
11+
// "count": 1,
12+
// "modifiers": ["ctrl", "shift"],
13+
// "command": "jump_back"
14+
// }
1515
]

plugin.py

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
# Publish Commands and EventListeners
2424
from .plugins.cmds import (
2525
CTagsAutoComplete,
26-
JumpPrev,
2726
NavigateToDefinition,
2827
RebuildTags,
2928
SearchForDefinition,

plugins/cmds.py

+1-51
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import subprocess
88
import threading
99

10-
from collections import defaultdict, deque
10+
from collections import defaultdict
1111
from itertools import chain
1212
from operator import itemgetter as iget
1313

@@ -448,54 +448,6 @@ def get_current_file_suffix(path):
448448
return file_suffix
449449

450450

451-
#
452-
# Sublime Commands
453-
#
454-
455-
# JumpPrev Commands
456-
457-
458-
class JumpPrev(sublime_plugin.WindowCommand):
459-
"""
460-
Provide ``jump_back`` command.
461-
462-
Command "jumps back" to the previous code point before a tag was navigated
463-
or "jumped" to.
464-
465-
This is functionality supported natively by ST3 but not by ST2. It is
466-
therefore included for legacy purposes.
467-
"""
468-
469-
buf = deque(maxlen=100) # virtually a "ring buffer"
470-
471-
def is_enabled(self):
472-
# disable if nothing in the buffer
473-
return len(self.buf) > 0
474-
475-
def is_visible(self):
476-
return setting("show_context_menus")
477-
478-
def run(self):
479-
if not self.buf:
480-
return status_message("JumpPrev buffer empty")
481-
482-
file_name, sel = self.buf.pop()
483-
self.jump(file_name, sel)
484-
485-
def jump(self, path, sel):
486-
@on_load(path, begin_edit=True)
487-
def and_then(view):
488-
select(view, sel)
489-
490-
@classmethod
491-
def append(cls, view):
492-
"""Append a code point to the list"""
493-
name = view.file_name()
494-
if name:
495-
sel = [s for s in view.sel()][0]
496-
cls.buf.append((name, sel))
497-
498-
499451
# CTags commands
500452

501453

@@ -562,7 +514,6 @@ def show_tag_panel(view, result, jump_directly):
562514

563515
def on_select(i):
564516
if i != -1:
565-
JumpPrev.append(view)
566517
# Work around bug in ST3 where the quick panel keeps focus after
567518
# selecting an entry.
568519
# See https://github.com/SublimeText/Issues/issues/39
@@ -632,7 +583,6 @@ def run(symbol, region, sym_line, mbrParts, view, tags_file):
632583

633584
if not tags:
634585
# append to allow jump back to work
635-
JumpPrev.append(view)
636586
view.window().run_command("goto_definition")
637587
return status_message('Can\'t find "%s"' % symbol)
638588

0 commit comments

Comments
 (0)