Skip to content

Wrong text alignment & cursor when editing JSON object-valued preferences via phantom button #347

Closed
@ratijas

Description

@ratijas

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

  1. Open menu Preferences > Package Settings > Package Control -> Settings.
  2. Split window should show up with default config on the left and user's prefs on the right.
  3. 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:
1-before

Actual result

After:
2-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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions