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

editor.renderFinalNewline: false has no effect, still shows empty line #80725

Closed
vogler opened this issue Sep 11, 2019 · 4 comments · Fixed by microsoft/azuredatastudio#7282
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-rendering Editor rendering issues verified Verification succeeded

Comments

@vogler
Copy link

vogler commented Sep 11, 2019

Issue Type: Bug

  "files.insertFinalNewline": true,
  "files.trimFinalNewlines": true,
  "files.trimTrailingWhitespace": true,
  "editor.renderFinalNewline": false, // seems to have no effect?
  "editor.wordWrap": "on",

image
git diff output as it should be:
image

To check a possible conflict with insertFinalNewline, I removed the visible empty line and got:
image
Note the dreaded 'No newline at end of file' which is not POSIX conform and makes diffs ugly (especially when also using vim).

VS Code version: Code 1.38.0 (3db7e09, 2019-09-03T21:47:00.464Z)
OS version: Darwin x64 18.7.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz (8 x 2500)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 1, 2, 2
Memory (System) 16.00GB (0.07GB free)
Process Argv -psn_0_1892814
Screen Reader no
VM 0%
Extensions (36)
Extension Author (truncated) Version
haskero Van 1.3.1
Bookmarks ale 10.5.0
spellright ban 3.0.46
npm-intellisense chr 1.3.0
gitignore cod 0.6.0
vscode-eslint dba 1.9.1
githistory don 0.4.6
xml Dot 2.5.0
gitlens eam 9.9.3
vscode-npm-script eg2 0.3.9
vscode-great-icons emm 2.1.47
reasonml fre 1.0.38
macros ged 1.2.1
ocaml-debugger hac 0.1.2
latex-workshop Jam 8.1.0
hoogle-vscode jca 0.0.7
dune mae 0.0.5
Lisp mat 0.1.9
vscode-cosmosdb ms- 0.11.0
vscode-docker ms- 0.7.0
python ms- 2019.9.34911
azure-account ms- 0.8.4
cpptools ms- 0.25.1
vscode-code-outline pat 0.2.1
platformio-ide pla 1.8.3
gi rub 0.2.11
vscode-gtm s3r 0.2.0
linter-xo sam 2.3.2
code-settings-sync Sha 3.4.2
vscoq sie 0.2.7
stylish-haskell vig 0.0.10
vscode-icons vsc 9.3.0
vim vsc 1.10.2
vscode-wakatime Wak 2.2.0
quokka-vscode Wal 1.0.243
better-align wwm 1.1.6

(4 theme extensions excluded)

@vogler
Copy link
Author

vogler commented Sep 11, 2019

Related: #1027, #70344

vogler added a commit to vogler/dotfiles that referenced this issue Sep 11, 2019
@alexdima
Copy link
Member

@vogler I cannot reproduce this. I am generating a file with the following script:

require('fs').writeFileSync(`test.txt`, `Line1\nLine2\n`);

and then I open the file:
TO_UPLOAD

@alexdima alexdima added the info-needed Issue requires more information from poster label Sep 13, 2019
@vogler
Copy link
Author

vogler commented Sep 14, 2019

Ok, very strange, it only happens in settings.json. For other files I get the same behavior as you.

Ideally, one shouldn't be able to put the cursor in the final newline (Gdd deletes the last line in vim, here it's a no-op; Go should append a line, here it appends an empty line and then opens a line).

@vogler
Copy link
Author

vogler commented Sep 14, 2019

It's a problem with word wrap:
vscode
Not clear from the recording: this happens not only if the last line wraps, but any line.

@alexdima alexdima added bug Issue identified by VS Code Team member as probable bug editor-rendering Editor rendering issues and removed info-needed Issue requires more information from poster labels Sep 16, 2019
@alexdima alexdima added this to the September 2019 milestone Sep 16, 2019
@mjbvz mjbvz added the verified Verification succeeded label Oct 3, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 31, 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 editor-rendering Editor rendering issues verified Verification succeeded
Projects
None yet
3 participants