Skip to content

Commit 0878992

Browse files
authored
Display warning when people use an older Vim (#1524)
* Display warning when people use an older Vim This shows a warning when people use an older Vim version. You can still set `g:go_no_version_warning` to override this, if people really want to continue. I don't think we need to bother documenting that setting in the help page. The version 7.4.1689 was chosen because that's what the latest Ubuntu LTS (16.04) uses, which seems like a reasonable choice. I don't mind using an older version though. * Explicitly check for 1 and improve wording. * Change variable name and add ChangeLog
1 parent cc93090 commit 0878992

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
## unplanned
22

3+
BACKWARDS INCOMPATIBILITIES:
4+
5+
* Display a warning for Vim versions older than 7.4.1689. Older versions may
6+
still work, but are not supported. You can use `let g:go_version_warning = 0`
7+
to disable the warning.
8+
[[GH-1524]](https://github.com/fatih/vim-go/pull/1524).
9+
310
BUG FIXES:
411

512
* Fix compatibility with Vim version before 7.4.1546

plugin/go.vim

+23
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,29 @@ if exists("g:go_loaded_install")
44
endif
55
let g:go_loaded_install = 1
66

7+
" Not using the has('patch-7.4.1689') syntax because that wasn't added until
8+
" 7.4.237, and we want to be sure this works for everyone (this is also why
9+
" we're not using utils#EchoError()).
10+
"
11+
" Version 7.4.1689 was chosen because that's what the most recent Ubuntu LTS
12+
" release (16.04) uses.
13+
if
14+
\ get(g:, 'go_version_warning', 1) != 0 &&
15+
\ (v:version < 704 || (v:version == 704 && !has('patch1689')))
16+
\ && !has('nvim')
17+
echohl Error
18+
echom "vim-go requires Vim 7.4.1689 or Neovim, but you're using an older version."
19+
echom "Please update your Vim for the best vim-go experience."
20+
echom "If you really want to continue you can set this to make the error go away:"
21+
echom " let g:go_version_warning = 0"
22+
echom "Note that some features may error out or behave incorrectly."
23+
echom "Please do not report bugs unless you're using Vim 7.4.1689 or newer."
24+
echohl None
25+
26+
" Make sure people see this.
27+
sleep 2
28+
endif
29+
730
" these packages are used by vim-go and can be automatically installed if
831
" needed by the user with GoInstallBinaries
932
let s:packages = {

0 commit comments

Comments
 (0)