JuliaEditorSupport / julia-vim

Vim support for Julia.
http://julialang.org/
Other
747 stars 93 forks source link

EditorConfig conflict #314

Open abelsiqueira opened 4 months ago

abelsiqueira commented 4 months ago

Disclaimer: Sorry if this is not accurate, I am not very familiar with vim/neovim internals.

On NeoVIM, the value of shiftwidth should be inferred from EditorConfig's indent_size, but it appears to be overwritten or unset by undo_ftplugin. I am using NeoVIM 0.9.5, and the configuration file is https://github.com/neovim/neovim/blob/master/runtime/ftplugin/julia.vim. By removing shiftwidth from line 27, the value of shiftwidth is properly inferred from editorconfig.

I think that #280 is related. shiftwidth was removed by 88f178c but reintroduced by #294.

The file from NeoVIM's repo says that this is the homepage for that file, but I noticed that they are not the same, so I was not sure where to report. Let me know if it's better to do there. That being said, when I use this file instead, I get the following error:

Error message ``` Error detected while processing BufReadPost Autocommands for "*": Error executing lua callback: ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:24: Error executing lua: ...brew/Cellar/neovim/0.9.5/share/nvim/ runtime/filetype.lua:25: BufReadPost Autocommands for "*"..FileType Autocommands for "*"..function 1_LoadFTPlugin[19]..script /opt/homebrew/Cellar/ne ovim/0.9.5/share/nvim/runtime/ftplugin/julia.vim, line 96: Vim(call):E117: Unknown function: julia_blocks#init_mappings stack traceback: [C]: in function 'nvim_cmd' ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:25: in function <...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:24> [C]: in function 'nvim_buf_call' ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:24: in function <...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:10> stack traceback: [C]: in function 'nvim_buf_call' ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:24: in function <...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:10> ```

Thanks in advance for the help. If the solution is creating a PR removing shiftwidth, I can definitely help.

carlobaldassi commented 2 months ago

With the latests version of the plugin, the issue with resetting shiftwidth should be solved by adding let g:julia_set_indentation=0 in your init.vim file.

The version shipped with neovim by default is a reduced version (this is also why you get that error when you try to just take the ftplugin.vim file from here). The part of the file in the reduced version with shiftwidth< expandtab< indentexpr< indentkeys< is wrong, those settings should just be removed from there.

Until that happens, what you can do is install the plugin from this repo using a plugin manager and then use g:julia_set_indentation as I was writing above.