-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
vimindent variable is not defined #14111
Comments
This is vim9 script. That is currenntly only valid when evaluating from within vim9 script context. I think it was discussed before, that one cannot easily call exported vim9 functions. |
I see. Thank you for clarifying. Problem seems to be that when older plugins check indentexpr for a vim filetype, they will run into the same undefined var issue. Example: https://github.com/Thyrum/vim-stabs If you load this plugin, edit a *.vim file, and toggle on autoindent, you get the same error So the function is being called outside of the vim9 script context all the time |
To prevent described error, I guess instead of Lines 17 to 19 in 13a0144
|
Steps to reproduce
vim --clean test.vim
:set indentexpr?
this returns
vimindent.Expr()
:echo vimindent.Expr()
this returns
E121: Undefined variable: vimindent
Expected behaviour
vimindent
should be definedThis can be temporarily sidestepped by using the old(?) function
:set indentexpr=GetVimIndent()
once inside the session. Trying to do it with an autocommand Filetype or modeline will not work, because then
GetVimIndent
won't be defined.Version of Vim
9.1.16
Environment
OS: Debian Sid
terminal: st
$TERM: tmux-256color
shell: 5.2.21
Logs and stack traces
No response
The text was updated successfully, but these errors were encountered: