editorconfig-vim icon indicating copy to clipboard operation
editorconfig-vim copied to clipboard

neovim fixendofline is enabled but insert_final_newline doesn't work

Open sandrodz opened this issue 8 years ago • 8 comments

insert_final_newline (Feature +fixendofline (available on Vim 7.4.785+) or PreserveNoEOL is required for this property)

in neovim this setting is ON by default, but newline is not inserted.

sandrodz avatar Jan 08 '17 22:01 sandrodz

Have the same issue

verkholantsev avatar Nov 03 '17 02:11 verkholantsev

Can you give detailed steps to reproduce?

xuhdev avatar Nov 03 '17 02:11 xuhdev

  1. Install the two plugins: In your ~/.config/nvim/init.vim:
" auto-install vim-plug
if empty(glob('~/.config/nvim/autoload/plug.vim'))
  silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \
      https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall
endif
call plug#begin('~/.config/nvim/plugged')
Plug 'editorconfig/editorconfig-vim'
Plug 'vim-scripts/PreserveNoEOL'
call plug#end()

Run :PlugInstall

  1. Check that ~/.config/nvim/plugged/editorconfig-vim/.editorconfig has insert_final_newline = true

  2. Open any existing file. Expected: newline appears at the end of file. Actual behaviour: no new line appears at the end of file.

This is the issue I'm having. Can anyone confirm that it is the same?

andrei-pavel avatar Apr 20 '18 10:04 andrei-pavel

I am also having same issue. I even have in my folder that vim is open in a .editorconfig and still same result

jrock2004 avatar May 10 '18 00:05 jrock2004

It is important to check, if the final newline is really present or not.

I use:

$ hexdump -c file.txt

for this purpose as it prints characters one by one in well readable format.

I was tricked a bit by LSP python document validation reporting that EOL was missing at the end of file while it was in fact present.

So I recommend @jrock2004 @sandrodz @xuhdev and @andrei-pavel to check presence of final newline using hexdump.

Tested on Debian 9 with neovim 0.3.0 and neovim 0.2.3 (installed using appimage)

vlcinsky avatar Jun 15 '18 10:06 vlcinsky

So I ran the hexdump command and it shows it but I guess we just have to assume everytime that this is working?

jrock2004 avatar Oct 26 '18 16:10 jrock2004

@jrock2004 To be honest, I don't know whether there is an easy way to do this. I think you'll get a more satisfactory answer from the neovim community.

xuhdev avatar Oct 26 '18 18:10 xuhdev

Have the same issue here.

huntzhan avatar Dec 08 '19 09:12 huntzhan