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

EditorConfig conflict #314

Open
abelsiqueira opened this issue Feb 21, 2024 · 1 comment
Open

EditorConfig conflict #314

abelsiqueira opened this issue Feb 21, 2024 · 1 comment

Comments

@abelsiqueira
Copy link

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 <SNR>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
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants