sublime_text icon indicating copy to clipboard operation
sublime_text copied to clipboard

`"show_line_column": "disabled"` leaves a trailing comma behind

Open kaste opened this issue 3 years ago • 5 comments

Description of the bug

The newest ST allows "show_line_column": "disabled" but when doing so it adds (or leaves behind) a trailing , (comma). It really is like you doing a ", ".join() and still have an entry in the status items array.

Steps to reproduce

  1. Start ST
  2. Make a view; in the console view.set_status("test", "message")
  3. Edit Preferences
  4. Add `"show_line_column": "disabled"
  5. Look at the status bar

image

Expected behavior

Can't do a visual mock.

Actual behavior

image

image

Sublime Text build number

4138

Operating system & version

Windows 11

(Linux) Desktop environment and/or window manager

No response

Additional information

No response

OpenGL context information

No response

kaste avatar Oct 18 '22 07:10 kaste

Ah, well, compact shows 1, 9. The standard format for that would be 1:9 really.

kaste avatar Oct 18 '22 08:10 kaste

A couple of people including me suggested a simple support for $line, $column template variables.

I feel like the current compact value might not satisfy the current audience of that feature as they won't like the formatting so it feels kinda pointless to introduce it this way.

The supported value could be changed to true, false or "string" where string is a template that the user can freely set using template variables. I guess it would still be possible to make a breaking change to this option since it was just introduced (and only in dev build).

rchl avatar Oct 18 '22 08:10 rchl

Personally, I'm -1 on template variables because it is not justified here, but line:col -- that is the : -- is a standard. And to put it on the right side then because out-of-the-box it looks like this

image

which is hard to decipher.

kaste avatar Oct 18 '22 08:10 kaste

The supported value could be changed to true, false or "string" where string is a template that the user can freely set using template variables. I guess it would still be possible to make a breaking change to this option since it was just introduced (and only in dev build).

As a alternative,

"show_line_column": "template",
"show_line_column_template": "Ln {row}, Col {col}",

jfcherng avatar Oct 18 '22 09:10 jfcherng

Nothing to add that hasn't already been said here or over in #2550, but commenting in case this helps this issue get more visibility.

Also glad that others noticed the unnecessary trailing comma when you make a call to view.set_status() with "show_line_column": "disabled".

pete-debiase avatar Oct 18 '22 16:10 pete-debiase

Fixed in build 4139.

BenjaminSchaaf avatar Oct 28 '22 03:10 BenjaminSchaaf