Skip to content

Commit

Permalink
minor tweak: version checking
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhao committed Jun 27, 2022
1 parent ae75947 commit 6dfaf2c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
" Blog: https://jdhao.github.io/

" check if we have the lastest stable version of nvim
if !has('nvim-0.7.2')
echohl Error | echomsg "Nvim 0.7.2 required, but is missing!" | echohl None
let s:expect_ver = printf('nvim-%s', '0.7.2')
let s:actual_ver = matchstr(execute('version'), 'NVIM v\zs[^\n]*')

if !has(s:expect_ver)
echohl Error | echomsg printf("%s required, but got nvim %s!", s:expect_ver, s:actual_ver) | echohl None
finish
endif

Expand Down

0 comments on commit 6dfaf2c

Please sign in to comment.