Closed cwebster2 closed 1 year ago
Can't reproduce, can you give more details?
https://github.com/romgrk/nvim-treesitter-context/blob/91869ed307084836e45abcf63a4fc0aee66a2d6e/lua/treesitter-context.lua#L369-L375 are the lines causing the error. I'm not reproing in a minimum config so this might be an interaction with something but I have not identified what, yet. I'm still investigating on my end for root cause.
Ok, maybe removing the silent
s there might give more details.
Why is this closed? I have the same issue. Interestingly , if I open a file with nvim test.py
it throws those errors, but if i open blank page with startify first, and then the file, it works just fine.
Removing silent
haven't produced more details.
Additionally, it seems that function after autogroups M.update_context()
is causing errors at the startup. If I comment this line, open a file and then execute :TSContextEnable, then no error is displayed, and context works just fine.
i closed it myself as i havent been able to devote time to finding root cause. I am opining it back up.
Leave open if it's not solved, no need to close.
As for the issue, is it reproducible with no other plugins but TS and TS-context? If not, can you do a binary search to pinpoint the plugin that interacts badly with this one?
Ok, so with all plugins disabled, it still throws all of those errors, but if I remove syntax on
and syntax enable
from the top of my init.vim, then it works again.
Also, I would like it more if plugin is disabled by default, and to open the context only when i really need it, so providing an option like context.vim:
let g:context_enabled = 0/1
seems like a natural thing to have.
We should probably wait until everything is loaded before enabling the plugin, something like autocmd VimEnter * TSContextEnable
, maybe nvim-treesitter isn't done loading yet.
Is it reproducible for you now?
We should probably wait until everything is loaded before enabling the plugin, something like
autocmd VimEnter * TSContextEnable
, maybe nvim-treesitter isn't done loading yet.
This is fine with me. I've deleted syntax enable
from top of my init.vim, because I
don't really need it there, so I'm currently not experiencing this issue.
Not reproducible with the latest build from master, on archlinux.
I am using latest neovim-nightly-bin from aur.
Output of nvim --version
:
NVIM v0.5.0-dev+1177-g095f5da79
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include
Compiled by runner@fv-az49-10
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/share/nvim"
Run :checkhealth for more info
And for me it is reproducable with this init.vim file
syntax enable
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim
call dein#begin('~/.cache/dein')
call dein#add('~/.cache/dein/repos/github.com/Shougo/dein.vim')
call dein#add('nvim-treesitter/nvim-treesitter')
call dein#add('romgrk/nvim-treesitter-context')
call dein#end()
filetype plugin indent on
syntax enable
As I said, I've removed syntax enable
from my init.vim, so this is not an issue for me any more, but still, I don't think that the plugin should behave like this in such case. Maybe @cwebster2 can check if syntax enable/on
is causing problems for him as well.
I have the same problem. syntax enable. When removed, it doesn't show the error.
@tex Remove syntax enable
from the beginning of the config and add it after treesitter is loaded (in my case that's after dein#end()
line.
Loading the treesitter-context package in the latest nightly causes this error
Latest neovim 0.5