dahu / vimple

Develop VimL
52 stars 2 forks source link

vimple#version#new doesn't parse neovim versions correctly #14

Closed ghost closed 6 years ago

ghost commented 6 years ago

In autoload/vimple/version.vim around line 45, the regexp that splits out the versions is fragile and breaks against neovim 0.3.1 on Arch:

Error detected while processing function vimple#version#new[75]..55:
line    4:
E688: More targets than List items
Press ENTER or type command to continue

This is because the substitution code can't handle the version "NVIM v0.3.1", which is how neovim on Arch reports it's version. Hardcoding the values around that lets vim run without errors from vimple.

dahu commented 6 years ago

Without the exact first line of the :version output, I'm flying blind. I guessed at this solution:

diff --git a/autoload/vimple/version.vim b/autoload/vimple/version.vim
index abb3e0c..be6af71 100644
--- a/autoload/vimple/version.vim
+++ b/autoload/vimple/version.vim
@@ -43,9 +43,9 @@ function! vimple#version#new()
     let [i['version'], i['major'], i['minor'], i['build_name'], i['compiled']] =
           \ split(
           \   substitute(info[0]
-          \   , '^N\?VIM.\{-}\(\(\d\+\)\.\(\d\+\)\).\{-}'
-          \       . '(\(.\{-}\)\%(,\s\+\S\+\s\+\(.\{-}\)\)\?)'
-          \   , '\1\n\2\n\3\n\4\n\5', '')
+          \   , '^N\?VIM.\{-}\(\(\d\+\)\.\(\d\+\)\(\.\(\d\+\)\)\?\)'
+          \       . '\(.\{-}(\([^,]\+\).*\)\?'
+          \   , '\1\n\2\n\3\n\5\n\7', '')
           \ , "\n", 1)
     let i['patches'] = substitute(info[1], '^.*:\s\+\(.*\)', '\1', '')
     let i['compiled_by'] = info[2]

I hope that helps. As I said in my previous response, you could just disable the loading of the vimple objects from within your ~/.vimrc.

Lastly, just so that you don't think I start to ignore you and this issue, I'm going to be away for about a week.

ghost commented 6 years ago

How about an echo info from within version.vim? Sorry about my inability to make this both fixed-width font, and wrapped.

['NVIM v0.3.1', 'Build type: Release', 'LuaJIT 2.0.5', 'Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -Wconversion -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -Wno-array-bounds -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.3.1/src -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include', 'Compiled by builduser', 'Features: +acl +iconv +jemalloc +tui ', 'See ":help feature-compile"', '   system vimrc file: "$VIM/sysinit.vim"', '  fall-back for $VIM: "/usr/share/nvim"', 'Run :checkhealth for more info']

Thanks for the hail mary, but the new regexp did not work; I get the same Less targets than List items error.

Edit: disabling stuff doesn't work, either, since this error happens in vimple initialization when it's parsing the vim version number.

ghost commented 6 years ago

Thanks, confirmed.

dahu commented 6 years ago

Great. Thanks for testing and confirming.