From 5bcc422503db1547f6e9b8dbcdc039b36e532c55 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 27 Feb 2024 13:42:52 -0400 Subject: st4: hsmusic: jump to next chunk of text w/ enter --- apps/Sublime Text 4/Packages/User/HSMusic Editing.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'apps/Sublime Text 4/Packages/User/HSMusic Editing.py') 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'}) -- cgit 1.3.0-6-gf8a5