-
Notifications
You must be signed in to change notification settings - Fork 33.4k
Border entire line, regardless of word wrap #247472
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
base: main
Are you sure you want to change the base?
Conversation
Depending on theme, the active line is highlighted with a background or border. Previously, when word wrap was enabled, the border did not surround the entire line. Move top and bottom borders to surround the entire line. Remove left and right borders -- these obscured text. Delete unused method "_shouldRenderOther". Tested with various combinations of workbench.colorTheme, editor.wordWrap and editor.renderLineHighlight.
Hi thank you @hickford for doing this PR. I wonder if we should merge this PR. Perhaps users are used to seeing the box surround the active view line and not the active mode line, and I wonder if they will be confused if we start surrounding the model line instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have thought about this some more and I am not sure if we should implement this so it is the default behavior. The reasons for this are the following.
- I have recently merged the feature which allows defining variable line heights in the editor, so a line can have a height of 30 and the one after can have a height of 50. The advantage of having the border surround the view line only and not the model line is that it allows the user to better grasp the exact height of the given view line (which can differ as explained). This is especially important when line numbers are not visible in the gutter.
- I think screen reader users may well be relying on the active view line being highlighted when coding. If the whole model line is highlighted, it makes it could make it hard to distinguish where the cursor is located for screen reader users.
As such I suggest we add a setting to control this behavior which will control whether we surround the view line or the model line. I think the default should be the current behavior.
As well as this I noticed you could simplify the code as follows:
Also generally we try to keep changes to a minimum in PRs so as to minimize the risk of breaking existing behavior so I would suggest to remove the |
Depending on theme, the active line is highlighted with a background or border. Previously, when word wrap was enabled, the border did not surround the entire line. This was confusing because commands like "cut" and "copy" apply to the entire line.
Move top and bottom borders to surround the entire line. Remove left and right borders -- these obscured text.
Delete unused method "_shouldRenderOther".
Tested with various combinations of workbench.colorTheme, editor.wordWrap and editor.renderLineHighlight.
Fixes #36839
Fixes #214857
Timeline: