chrisbra / matchit

The matchit plugin from Vim
61 stars 9 forks source link

Not an editor command: scriptversion 4 #30

Closed vxsx closed 3 years ago

vxsx commented 3 years ago

First time using matchit results in this error, subsequent tries seem to work

Error detected while processing ~/.vim/bundle/matchit/autoload/matchit.vim:
line    5:
E492: Not an editor command: scriptversion 4

I'm using neovim, which is probably why

:version
NVIM v0.4.4
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=au
to -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/tmp/neovim-20200808-17465-1c37yvx/neovim-0.4.4/build/config -I/tmp/neovim-20200808-17465-1c37yvx/neovim-0.4.4/src -I/usr/local/include -I/tmp/neovim-20200808-17465-1c37yvx/neovim-0.4.4/deps-build
/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/usr/local/opt/gettext/include -I/tmp/neovim-20200808-17465-1c37yvx/neovim-0.4.4/build/src/nvim/auto -I/tmp/neovim-20200808-17465-1c37yvx/neovim-0.4.4/build/include
Compiled by brew@Mojave

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.4.4/share/nvim"

Run :checkhealth for more info

not exactly sure how to fix this

chrisbra commented 3 years ago

Args, Does neovim support the .. operator to concatenate strings? if not, that is a deal breaker and I may have to revert that commit.

vxsx commented 3 years ago

I honestly don't know, however locally i just did this:

if has('vimscript-4')
  scriptversion 4
endif

and everything seems to work correctly, haven't encountered any problems so far. I have no idea if it would actually work on normal vim though.

chrisbra commented 3 years ago

thanks, looks like it supports .. for concatenating (Simple test: :echo "foo" .. "bar"). So I have pushed your suggested change. Thanks!