« get me outta code hell

dotfiles - Miscellaneous configuration files of my personal use
about summary refs log tree commit diff
path: root/apps/Sublime Text 4/Packages/User/HSMusic Editing.py
diff options
context:
space:
mode:
Diffstat (limited to 'apps/Sublime Text 4/Packages/User/HSMusic Editing.py')
-rw-r--r--apps/Sublime Text 4/Packages/User/HSMusic Editing.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/Sublime Text 4/Packages/User/HSMusic Editing.py b/apps/Sublime Text 4/Packages/User/HSMusic Editing.py
index 22e7db7..232ecd3 100644
--- a/apps/Sublime Text 4/Packages/User/HSMusic Editing.py
+++ b/apps/Sublime Text 4/Packages/User/HSMusic Editing.py
@@ -247,6 +247,14 @@ class ExitWikiTagCommand(_CursorAdaptiveCommand):
     if rest_of_tag:
       return ('collapse_move', len(rest_of_tag))
 
+    region = _normalize_region(region)
+    to_start = sublime.Region(self.view.line(region).a, region.a)
+    to_end = sublime.Region(region.a, self.view.line(region).b)
+    if to_start.a != to_start.b and to_end.a != to_end.b:
+      match = re.search('.*?([).,:;!?][).,:;!?"\']*|\\s(?=[(\'"])|[\'"](?=\\s|$)|$)', self.view.substr(to_end))
+      if match:
+        return ('collapse_move', len(match.group(0)))
+
   def no_action_fallback(self, edit):
     self.view.run_command('insert', {'characters': '\n'})