SublimeText / PackageDev

Tools to ease the creation of snippets, syntax definitions, etc. for Sublime Text.
MIT License
436 stars 83 forks source link

Settings: Fix completion values #348

Closed ratijas closed 2 years ago

ratijas commented 3 years ago

The root cause was that text manipulation was reordered in a wrong way: JSON-encoded string was converted to snippet-field-content-encoded string first, but then it was treated as a simply JSON-encoded string again. Namely, stripping curly brackets away after encoding them as \} broke cursor things in a weird ways.

Used pretty printing just because it looks better. But it required extra whitespace stripping: both outside and inside stripped brackets/braces.

Also changed variable name from encoded to content in fmt, so they can never be accidentally reordered again.

Fixes #347

ratijas commented 3 years ago

ping @FichteFoll

FichteFoll commented 3 years ago

Sorry for the delay. I took a very brief look but haven't found the time to finish up a release where this would then be included (I already added the milestone of the next version). I don't want to make promises, but I have some free time on Thursday where I hope to finally get to PD again.

ratijas commented 3 years ago

take your time :)

FichteFoll commented 2 years ago

Thanks, works really well and pretty-printing is a good idea, especially since we already insert the content in a new line.

(Sorry again for the delay.)

Edit: re-added commit message via bfa509b49593e930371abdfd9a873d0586d5d96e.