test.inp
:e
and then ENTER
. Then you get the following error.Error detected while processing BufRead Autocommands for "*.inp"..function dist#ft#Check_inp[2]..FileType Autocommands for "*"..function <SNR>17_LoadFTPlugin:
line 3:
E1269: Cannot create a Vim9 script variable in a function: s:cpo_save
It should not have this warning or error.
I have no plugins. The output can also be replicated running gvim -u DEFAULTS
. I do not have .vim
folder.
My ~/.vimrc looks as follows:
colorscheme evening
set guifont=Monospace\ 11
" visualizes line number
set number
set nocompatible
syntax enable
syntax on
" autoupdates file
set autoread
filetype plugin indent on
" sets the window to maximized when opened
set lines=999 columns=999
" updates file after buffer change
au FocusGained,BufEnter *.* :checktime
" keymap for :e = reloading the current buffer
nnoremap <F5> :edit<CR>
" list the contents of the current folder
nnoremap <F6> :!ls<CR>
" source ~/.vimrc
nnoremap <F7> :so $MYVIMRC<CR>
VIM - Vi IMproved 8.2
OS: Manjaro - Arch Linux
output of $TERM: xterm-256color
shell: bash (but the problem at hand pertains to GVim not vi)
Terminal: konsole (but the problem at hand pertains to GVim not vi)
I do not know what these mean. Please write to me how I can get them, if you need them
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I think that's because the abaqus filetype plugin tries to save a script-local variable from b:undo_ftplugin
which is wrong, because the latter is run in the global context, where any item in the script-local namespace is not available.
Patch fixing the issue:
diff --git a/runtime/ftplugin/abaqus.vim b/runtime/ftplugin/abaqus.vim index b263d0c31..42e58c2da 100644 --- a/runtime/ftplugin/abaqus.vim +++ b/runtime/ftplugin/abaqus.vim @@ -86,11 +86,11 @@ let b:undo_ftplugin .= "|unmap <buffer> [[|unmap <buffer> ]]" \ . "|unmap <buffer> <LocalLeader><LocalLeader>" " Undo must be done in nocompatible mode for <LocalLeader>. -let b:undo_ftplugin = "let s:cpo_save = &cpoptions|" +let b:undo_ftplugin = "let b:cpo_save = &cpoptions|" \ . "set cpoptions&vim|" \ . b:undo_ftplugin - \ . "|let &cpoptions = s:cpo_save" - \ . "|unlet s:cpo_save" + \ . "|let &cpoptions = b:cpo_save" + \ . "|unlet b:cpo_save" " Restore saved compatibility options let &cpoptions = s:cpo_save
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Closed #10391.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Looks like this plugin hasn't changed in ten years. Let me just include that fix now.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Me as a novice linux user. What do I do so that this issue is resolved in my computer.
Should I wait for the next release ?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Should I wait for the next release ?
You need to wait for the next update of the runtime files. The latest one was pushed 2 days ago. The next one will probably happen in a few days or weeks.
From then, it depends on how you update your Vim version. For example, if you rely on the package manager of your OS, then you'll need to wait for the packaging of a more recent version.
If you want an immediate fix, try to run these shell commands:
$ curl --fail --location --show-error --silent --output $HOME/.vim/ftplugin/abaqus.vim https://raw.githubusercontent.com/vim/vim/master/runtime/ftplugin/abaqus.vim
$ sed -i '/let b:undo_ftplugin = "let s:cpo_save = &cpoptions|"/,/^$/s/s:/b:/g' /home/lgc/.vim/ftplugin/abaqus.vim
The first command copies the latest version of the abaqus filetype plugin in your home directory.
The second command applies the fix.
Your custom version of the filetype plugin will have priority over the default one, because – inside the runtimepath – your home config (~/.vim/
) appears before the default one ($VIMRUNTIME
).
The runtimepath is to Vim what $PATH
is to the shell. See :help 'runtimepath'
.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
If you want an immediate fix, try to run these shell commands:
Or execute these Ex commands:
:call mkdir($HOME . '/.vim/ftplugin/', 'p')
:edit $HOME/.vim/ftplugin/abaqus.vim
:read $VIMRUNTIME/ftplugin/abaqus.vim
:silent 90,94 substitute/s:/b:/
:write
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Thank you for your explanation. :)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.