-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Opening multiple files with -p with nightly neovim has different tabstop & expandtab values on second tab #28759
Comments
How did you set these options in your config? How did you load nvim-treesitter? |
In my lua config, I have the following 2 lines
I use the "lazy" plugin manager. I have this line in my main plugin lua file
Then my setup for treesitter is
|
Run nvim with the
and see where this option is set. |
When I run nvim -V1 -p file1.php file2.php when in the second tab for the second file it says |
Please remember to provide full reproducible steps as instructed in the issue template. If one has to make a guess, the lines 7, 8 in
The |
In my lua config, I have the following 2 lines, for line numbers 7 & 8.
This problem doesn't exist with the exact same config files and neovim version 0.9.5 |
Can you reproduce this with a file containing only these two lines and |
when running the following with the nightly
it works as expected, the issue isn't present test.lua only contains the following 2 lines as suggested
|
Then your problem lies somewhere in your config. Add stuff to the minimal test file until you can reproduce. (The issue is usually some plugin.) |
If I don't load the nvim-treesitter plugin it works fine. I tried opening a bug with nvim-treesitter and they closed it saying it can't be caused by that... |
But is nvim-treesitter the only plugin you load? What is your configuration for thst plugin? (Don't install all languages blindly.) |
I use the "lazy" plugin manager and install the following plugins
My config for nvim-treesitter is
|
Yeah, that's too many. Reduce to the absolute minimum. |
I tried several things based on your snippets, but I still can't reproduce the issue OP is describing, with and without nvim-treesitter. Once you manage to find a full, self-contained, clear reproduction steps based on https://github.com/neovim/neovim/blob/master/contrib/minimal.lua (please don't use lazy.nvim), please feel free to ask further help. |
I tried some more things this morning to try and get it to happen on the nightly without using lazy and very minimal config, but wasn't able to get it to happen that way. I'm just going to go back to neovim 0.9.5 for now where this problem doesn't occur and hope that whatever the underlying issue is gets fixed when 0.10 gets fully released. |
Neovim 0.10 is being released right now. So keep testing. |
@jthemenace have you tried adding: vim.opt.shiftwidth = 2
vim.opt.expandtab = true or vim.opt.tabstop = 2
vim.opt.shiftwidth = 0
vim.opt.expandtab = true both works for me, while: vim.opt.tabstop = 2
vim.opt.expandtab = true (without shiftwidth) will make the tab size be 8 spaces. Looks like a bug to me, I am on |
I have the same or similar issue but the way to reproduce it is different. I'm on macOS, neovim 0.10.0 installed with brew and many plugins for Go dev. So if I open 2 Go files, i.e But if I navigate to a different file via LSP go to definition This was not happening in neovim 0.9.5. |
After this issue was closed, I opened one with lazy.nvim here Someone mentioned it was a duplicate of this one that had the fix / answer. I had to put my expandtab / tabstop setting(along with a few others) in my config BEFORE the lazy plugin manager is loaded. Once I did that it started working fine. |
Problem
When running on neovim nightly and nvim-treesitter is enabled, when I open 2 files using the -p command, the second tab doesn't have my configured tabstop & expandtab values from my config, however the first tab does. If I don't load nvim-treesitter it works perfectly fine.
Steps to reproduce
nvim -p file1.php file2.php
go to second tab, view settings of expandtab and tabstop
:set expandtab?
:set tabstop?
compare them with values from first tab, see that they are different
Expected behavior
I expect all tabs to have the same value from my config for expandtab & tabstop
Neovim version (nvim -v)
NVIM v0.10.0-dev-3122+ga0a189a8e
Vim (not Nvim) behaves the same?
no
Operating system/version
Debian Linux 12.5
Terminal name/version
iTerm 2 3.5
$TERM environment variable
tmux-256color
Installation
appimage
The text was updated successfully, but these errors were encountered: