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

Default value for renderFinalNewline on Linux is bad for conditioned users #70126

Closed
dlech opened this issue Mar 9, 2019 · 2 comments · Fixed by #70127
Closed

Default value for renderFinalNewline on Linux is bad for conditioned users #70126

dlech opened this issue Mar 9, 2019 · 2 comments · Fixed by #70127
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@dlech
Copy link
Contributor

dlech commented Mar 9, 2019

#64667 introduced a new setting renderFinalNewline. The choice was made that on Linux, the default value for this setting is true which changes the behavior from versions of VS Code before the setting was introduced.

Without realizing the default behavior has been changed, I have been adding double newlines to the end of files since I have upgraded to v1.32 because I have become conditioned to the display of line numbers on all lines. I was quite surprised to find that I could put the cursor on a line without a line number! I suspect that I am not the only user that has developed such conditioning. Changing the default behavior was certainly not very nice for my UX.

@glen-84
Copy link

glen-84 commented Mar 9, 2019

You're not the only one to be surprised by this change – #69129, #70344.

It wasn't even (prominently) mentioned in the update notes, which is a surprise in itself.

Ideally, Linux users could have been prompted to make a choice when upgrading VS Code. Failing that, the only other reasonable option seems to be to default to true. It's unfortunate (since it's not really "correct"), but as you say, many users have been conditioned to expect this numbered empty line at the end of files.

I personally use Windows, but since I work on projects with Linux EOL characters and have the EditorConfig insert_final_newline setting enabled, I've actually set renderFinalNewline to false so that I no longer have this "blank line" at the end of files. It's going to take some getting used to, but I still believe that it is the correct behaviour.

@glen-84
Copy link

glen-84 commented Mar 14, 2019

A third option may be to display some kind of character/symbol to indicate that the last line ends with a \n.

Something like this:

image

I mentioned this here as well (with some alternatives).

In that way, you know that the last line is terminated, and where to place your cursor, without erroneously numbering that as a line.

@alexdima alexdima removed the editor-find Editor find operations label Mar 27, 2019
@alexdima alexdima added this to the March 2019 milestone Mar 27, 2019
@alexdima alexdima added the bug Issue identified by VS Code Team member as probable bug label Mar 27, 2019
@jrieken jrieken added the verified Verification succeeded label Mar 28, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators May 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants