Skip to content
Permalink
Browse files

Fixed soft_undo unselecting all words at once

Soft undo does not work for the same text command called multiple times
SublimeTextIssues/Core#2924
  • Loading branch information...
evandrocoan committed Aug 11, 2019
1 parent 47ed043 commit d58b5442e8f2b2248f7d6c7f9395b10f562bee7d
Showing with 16 additions and 2 deletions.
  1. +16 −2 word_highlight.py
@@ -167,11 +167,18 @@ def run(self, edit):
class SelectHighlightedNextWordCommand(sublime_plugin.TextCommand):
def run(self, edit):
view = self.view
selections = view.sel()

if not view.has_non_empty_selection_region():
Pref.is_on_whole_word_mode = True

sublime.set_timeout( lambda: view.run_command( 'select_highlighted_next_word_bug_fixer' ), 0 )


class SelectHighlightedNextWordBugFixerCommand(sublime_plugin.TextCommand):
def run(self, edit):
view = self.view
selections = view.sel()

# print( 'selections', selections )
if selections:
word_regions = view.get_regions( 'HighlightWordsOnSelection' )
@@ -214,11 +221,18 @@ def run(self, edit):
class SelectHighlightedPreviousWordCommand(sublime_plugin.TextCommand):
def run(self, edit):
view = self.view
selections = view.sel()

if not view.has_non_empty_selection_region():
Pref.is_on_whole_word_mode = True

sublime.set_timeout( lambda: view.run_command( 'select_highlighted_previous_word_bug_fixer' ), 0 )


class SelectHighlightedPreviousWordBugFixerCommand(sublime_plugin.TextCommand):
def run(self, edit):
view = self.view
selections = view.sel()

# print( 'selections', selections )
if selections:
word_regions = view.get_regions( 'HighlightWordsOnSelection' )

0 comments on commit d58b544

Please sign in to comment.
You can’t perform that action at this time.