You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In preferences split editor, inline phantom button with pencil icon in the left pane sometimes misbehaves: when inserting new preferences entry to the right page, it may misalign text and cursor with selection. The bug seem to affect json map (object) values preferences. Note that there aren't any of such objects in the general User/Preferences.sublime-settings, so check out Package Control.sublime-settings instead.
Steps to reproduce
Open menu Preferences > Package Settings > Package Control -> Settings.
Split window should show up with default config on the left and user's prefs on the right.
Click phantom pencil icon on any preference which has JSON object default value on the left, and which is not yet defined on the right.
Before:
Actual result
After:
Expected result
Expected to see something similar to what happens with JSON arrays:
new preference name on its own line, followed by double-colon,
JSON object's curly braces on their own lines below,
cursor between braces on its own line, indented.
Like this (cursor is denoted by ${|}):
"install_prereleases":
[
${|}
],
Version
Operating System: Arch Linux
Kernel Version: 5.12.9-arch1-1
OS Type: 64-bit
Graphics Platform: X11
Sublime Text: Stable, Build 4107
The text was updated successfully, but these errors were encountered:
ratijas
changed the title
Wrong text alignment & cursor position after clicking phantom button in references editor
Wrong text alignment & cursor when editing JSON object-valued preferences via phantom button
Jun 10, 2021
ratijas
added a commit
to ratijas/PackageDev
that referenced
this issue
Jun 11, 2021
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.
FixesSublimeText#347
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
Description
In preferences split editor, inline phantom button with pencil icon in the left pane sometimes misbehaves: when inserting new preferences entry to the right page, it may misalign text and cursor with selection. The bug seem to affect json map (object) values preferences. Note that there aren't any of such objects in the general User/Preferences.sublime-settings, so check out Package Control.sublime-settings instead.
Steps to reproduce
Before:
Actual result
After:
Expected result
Expected to see something similar to what happens with JSON arrays:
Like this (cursor is denoted by
${|}
):Version
Operating System: Arch Linux
Kernel Version: 5.12.9-arch1-1
OS Type: 64-bit
Graphics Platform: X11
Sublime Text: Stable, Build 4107
The text was updated successfully, but these errors were encountered: