Skip to content

Display warning when people use an older Vim #1524

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

Merged
merged 3 commits into from
Oct 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## unplanned

BACKWARDS INCOMPATIBILITIES:

* Display a warning for Vim versions older than 7.4.1689. Older versions may
still work, but are not supported. You can use `let g:go_version_warning = 0`
to disable the warning.
[[GH-1524]](https://github.com/fatih/vim-go/pull/1524).

BUG FIXES:

* Fix compatibility with Vim version before 7.4.1546
Expand Down
23 changes: 23 additions & 0 deletions plugin/go.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@ if exists("g:go_loaded_install")
endif
let g:go_loaded_install = 1

" Not using the has('patch-7.4.1689') syntax because that wasn't added until
" 7.4.237, and we want to be sure this works for everyone (this is also why
" we're not using utils#EchoError()).
"
" Version 7.4.1689 was chosen because that's what the most recent Ubuntu LTS
" release (16.04) uses.
if
\ get(g:, 'go_version_warning', 1) != 0 &&
\ (v:version < 704 || (v:version == 704 && !has('patch1689')))
\ && !has('nvim')
echohl Error
echom "vim-go requires Vim 7.4.1689 or Neovim, but you're using an older version."
echom "Please update your Vim for the best vim-go experience."
echom "If you really want to continue you can set this to make the error go away:"
echom " let g:go_version_warning = 0"
echom "Note that some features may error out or behave incorrectly."
echom "Please do not report bugs unless you're using Vim 7.4.1689 or newer."
echohl None

" Make sure people see this.
sleep 2
endif

" these packages are used by vim-go and can be automatically installed if
" needed by the user with GoInstallBinaries
let s:packages = {
Expand Down