Closed mcwatson123 closed 5 months ago
Could you add a minimal reproduction, such that one can do nvim --clean -u minimal.vim
and have the bug occur (example).
I see that there is a reproduction here, but without a self-contained example it will be hard to track this down.
Sorry if this is burdensome! I appreciate the detailed report so far.
@Iron-E I tried this
nvim --clean -u minimal.vim
When the file first opened, I didn't encounter any error messages. This might have something to do with Nvim-treesitter and Nvim-tree. That's pretty much all I know about it.
What was the content of the minimal file?
Too many errors here
Sorry in advance for any confusion, I'll try to clarify. Let me know if you have further questions!
In a minimal file you'll want to leave out :Plug
commands; Plug is responsible for installing plugins and loading them when neovim starts. However, we want to reduce the number of commands being run to as few as possible, so we can do without :Plug
for now— here's how. If you put the installation location of barbar.nvim
in the &rtp
manually, it will load on its own.
After that, you can continue putting as little from your config (keeping relevant lines, such as your autocmds from the original post) as possible. Finally, remove any lines that allow the error you've encountered to remain.
Keep in mind, if you want to copy the example I linked into a .vim
file, you can do this:
lua << EOF
-- lua goes here
EOF
@Iron-E
call plug#begin('C:/Users/Mackenzie Watson/AppData/Local/nvim-data/plugged')
---some codes------
Plug 'romgrk/barbar.nvim' " for tabline
--some codes---
call plug#end()
in init.vim (or what you said "minimal file") and as a result there is no harm in using the Plug command in init.vim, whereas you said I should "leave out" (delete?) :Plug.
lua <<EOF
require('barbar').setup({
exclude_ft = {'terminal', 'pwsh.exe', 'C:/Program Files/PowerShell/7'},
exclude_name = {'terminal', 'pwsh.exe', 'C:/Program Files/PowerShell/7/pwsh.exe', '/bin/bash'},
-- Enable/disable animations
animation = true,
-- Automatically hide the tabline when there are this many buffers left.
-- Set to any value >=0 to enable.
auto_hide = false,
------------
})
nvim D:/Documents/.../input.py
and in it I did
:echo &rtp
, as a result I already have the "path to barbar.nvim", as shown below.
choco upgrade --pre
) to the latest version and I have updated it to version 0.10.0 and the result is the error still the same. Below is the image for the given input.py file (:version
)and this is the error
Sorry again for any confusion— I'll try to explain a different way :)
Put the contents of the following code block into a file called "minimal.lua" on your computer:
vim.opt.rtp:append {
'~/.local/share/nvim/lazy/barbar.nvim', -- or your install path
-- other plugins can be loaded this way too
}
require'barbar'.setup {
-- put the setup options here
}
-- the minimal lines required to make the bug appear
vim.cmd [[
" vimscript goes in here if necessary
]]
Then edit the lines with comments so that they fit your requirements.
With this configuration, barbar can be loaded without Plug, which improves the chances of figuring out the one thing which is causing the problem.
The goal is:
nvim --clean -u minimal.lua
:edit
a python fileYou can start out pasting big blocks of your main config, and then reduce it until you're left with the smallest amount that still causes the bug to happen
Hopefully this helps!
Closing for now, feel free to reopen if there are any changes!
Description
I have a problem related to Python files when they are opened through nvim filename.py in PowerShell 7 Windows 11. I always set up Neovim with the autocommand VimEnter to achieve the layout I desire, especially in the following code snippet:
I have also tried :PlugInstall and PlugUpdate and the output for barbar.nvim is "OK" and "Already Up to Date"
Steps to Reproduce
The issue arises when the autocommand executes Barbar's proprietary commands, such as BufferNext and BufferClose, and an error occurs as follows:
Here's a breakdown of the relevant code sections:
Line 198 in events.lua:
Line 215 in api.lua:
Line 34 in barbar.lua:
Screenshots
When I opened barbar.lua (other than python extension)![image](https://github.com/romgrk/barbar.nvim/assets/147148091/a8ba0490-4e3c-45a6-bb80-78fbd28c240f)
When I created and opened newFile.py![image](https://github.com/romgrk/barbar.nvim/assets/147148091/f0e19c94-c0fa-4e70-9dbf-ffba09bbbf44)
When I typed :NvimTreeOpen in that file![image](https://github.com/romgrk/barbar.nvim/assets/147148091/0f5d7ef4-29f0-4416-ab1b-f792eef4d9f6)
Informations
Neovim version: NVIM v0.9.2 Build type: RelWithDebInfo LuaJIT 2.1.1694082368
:checkhealth output coc: health#coc#check
OK nvim version satisfied
OK Environment check passed
WARNING pyx command not work, some extensions may fail to work, checkout ":help |pythonx|"
WARNING Install pynvim by command:
pip install pynvim --upgrade
OK Javascript bundle build/index.js found
OK Service started
============================================================================== nvim: require("nvim.health").check()
Configuration ~
Runtime ~
Performance ~
Remote Plugins ~
============================================================================== nvim-lsp-installer: require("nvim-lsp-installer.health").check()
nvim-lsp-installer report ~
9.5.0
v18.15.0
Python 3.9.10
javac 11.0.16.1
java version "11.0.16.1" 2022-08-18 LTS
GNU Wget 1.21.4 built on mingw32.
curl 8.0.1 (Windows) libcurl/8.0.1 Schannel WinIDN
gzip 1.3.12
bsdtar 3.5.2 - libarchive 3.5.2 zlib/1.2.5.f-ipp bz2lib/1.0.6
Ok
`
java version "11.0.12" 2021-07-20 LTS
============================================================================== nvim-treesitter: require("nvim-treesitter.health").check()
Installation ~
tree-sitter
executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)node
found v18.15.0 (only needed for :TSInstallFromGrammar)git
executable found.gcc
executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" } Version: gcc.exe (x86_64-posix-seh-rev2, Built by MinGW-W64 project) 12.2.0OS Info: { machine = "x86_64", release = "10.0.22621", sysname = "Windows_NT", version = "Windows 11 Home Single Language" } ~
Parser/Features H L F I J
vimdoc ✓ . . . ✓
Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections +) multiple parsers found, only one will be used x) errors found in the query, try to run :TSUpdate {lang} ~
============================================================================== provider: health#provider#check
Clipboard (optional) ~
Python 3 provider (optional) ~
import neovim
. Using the first available executable for diagnostics.Python virtualenv ~
Ruby provider (optional) ~
ruby
andgem
must be in $PATH.ruby
andgem
commands work.Node.js provider (optional) ~
Perl provider (optional) ~
============================================================================== telescope: require("telescope.health").check()
Checking for required plugins ~
Checking external dependencies ~
live-grep
finder will not function without BurntSushi/ripgrep installed.===== Installed extensions ===== ~
============================================================================== vim.lsp: require("vim.lsp.health").check()
vim.lsp: Active Clients ~
============================================================================== vim.treesitter: require("vim.treesitter.health").check()