Skip to content

[Common] Auto-pair triple-quoted strings - #4589

Merged
deathaxe merged 9 commits into
sublimehq:masterfrom
deathaxe:pr/common/auto-pair-block-strings
Oct 1, 2026
Merged

deathaxe merged 9 commits into
sublimehq:masterfrom
deathaxe:pr/common/auto-pair-block-strings

Conversation

@deathaxe

Copy link
Copy Markdown
Collaborator

Resolves #4584

This PR adds key bindings to auto-pair triple quoted strings in Groovy, Java, Python and TOML.

jrappen
jrappen previously approved these changes Jul 22, 2026
@michaelblyons

Copy link
Copy Markdown
Collaborator

I haven't tried the macros yet, but I'm curious about a minor thing: Can we use trailing commas in Sublime JSONC so that adding and removing lines doesn't touch the lines around it?

@jrappen

This comment was marked as resolved.

@deathaxe

Copy link
Copy Markdown
Collaborator Author

With regards to trailing commas, the style follows style of files in Default package, vast majority of which avoid them.

With regards to trailing newline at eof, it is of no syntactical use.

@michaelblyons

Copy link
Copy Markdown
Collaborator

I'm trying the Python one, and it's not doing what I expect for expansion.

foo = |
foo = '|'
foo = ''|
foo = '''|
# Expected '''|''', right?

Same for "

For deletions, I think it looks good:

foo = '''|'''
foo = '|'
foo = |

deathaxe added 2 commits July 24, 2026 18:40
This commit changes `string.quoted.triple` to `string.quoted.double.block`
in Java syntax to align with Groovy, Python and TOML.
This commit ensures...

   ```
   string_value = """

   ""|
   ```

... to expand to ...

   ```
   string_value = """

   """|
   ```

... but not ...

   ```
   string_value = """

   """|"""
   ```

 It generally disables related binding within block strings to avoid unwanted
 text manipulation being triggered which no easy workarounds exist for.
michaelblyons
michaelblyons previously approved these changes Aug 19, 2026
Comment thread Groovy/Default.sublime-keymap Outdated
Comment thread Groovy/Default.sublime-keymap Outdated
Comment thread Java/Default.sublime-keymap Outdated
Comment thread Java/Default.sublime-keymap Outdated
Comment thread Python/Default.sublime-keymap Outdated
Comment thread Python/Default.sublime-keymap Outdated
Comment thread TOML/Default.sublime-keymap Outdated
Comment thread TOML/Default.sublime-keymap Outdated
Comment thread TOML/Default.sublime-keymap Outdated
Comment thread TOML/Default.sublime-keymap Outdated
@jrappen

jrappen commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

looks fine other than a few minor details from what I can tell from a quick look

@deathaxe
deathaxe merged commit 7206529 into sublimehq:master Oct 1, 2026
2 checks passed
@deathaxe
deathaxe deleted the pr/common/auto-pair-block-strings branch October 1, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Python] Auto-pair triple quotes

3 participants