editorconfig / editorconfig-vim

EditorConfig plugin for Vim
http://editorconfig.org
Other
3.14k stars 139 forks source link

neovim fixendofline is enabled but insert_final_newline doesn't work #74

Open sandrodz opened 7 years ago

sandrodz commented 7 years ago

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.

verkholantsev commented 7 years ago

Have the same issue

xuhdev commented 7 years ago

Can you give detailed steps to reproduce?

andrei-pavel commented 6 years ago
  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

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

  3. 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?

jrock2004 commented 6 years ago

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

vlcinsky commented 6 years ago

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)

jrock2004 commented 6 years ago

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

xuhdev commented 6 years ago

@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.

huntzhan commented 4 years ago

Have the same issue here.