Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"wrap_width_style": "min", "draw_centered": true cause the text column to widen as longer lines are inserted. #5036

Open
matj1 opened this issue Nov 12, 2021 · 0 comments

Comments

@matj1
Copy link

matj1 commented Nov 12, 2021

Description of the bug

With "word_wrap" enabled, "wrap_width_style" set to "min" and "draw_centered" enabled, the centered column of text is only as wide as the widest visual line of the text. This causes that inserting a line visually wider than other lines shifts all lines to the left.

The widening of the column is annoying and I was told by bschaaf on Discord that "wrap_width_style": "min" is supposed to cause that lines wrap at the minimum of "wrap_width" and the width of the view.

A demonstration of it (not in safe mode, but it looks almost the same there):

Nahravka_obrazovky_z_8.11.2021_154934.mp4

Steps to reproduce

  1. Start Sublime Text in safe mode.

  2. Set these settings:

    {
    	"word_wrap": true, // optional
    	"wrap_width": 60, // optional
    	"wrap_width_style": "min",
    	"draw_centered": true,	
    }
    

    (The optional settings aren't needed to reproduce the bug itself; they are there to more closely reproduce the behavior in the video demonstration.)

    An empty buffer shall have the caret in the middle.

  3. Insert a short line.

  4. Insert a wider line. It shall shift the first (shorter) line to the left because the centred text column widens. If any line visually wider than all other lines is inserted, it widens the centred column, so it shifts all lines to the left.

Expected behavior

With "word_wrap" enabled, "wrap_width_style" set to "min" and "draw_centered" enabled, the width of the centred column of text should be always the minimum of "wrap_width" and the width of the view.

Actual behavior

With these settings, the width of the centred column of text is only as wide as the widest visual line.

Sublime Text build number

4121

Operating system & version

Manjaro 21.1.6-1

(Linux) Desktop environment and/or window manager

Plasma 5.22.5 on X11

Additional information

No response

OpenGL context information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants