Skip to content

Commit 5ab8b73

Browse files
authored
Merge pull request #2495 from rbisewski/rbisewski/vim-go/2488-drop-vim-7.4-support
Removing logic needed to support Vim 7.4 as it has been dropped.
2 parents 041ca96 + b1826c7 commit 5ab8b73

File tree

17 files changed

+39
-75
lines changed

17 files changed

+39
-75
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ notifications:
55
email: false
66
matrix:
77
include:
8-
- env: SCRIPT="test -c" VIM_VERSION=vim-7.4
98
- env: SCRIPT="test -c" VIM_VERSION=vim-8.0
109
- env: SCRIPT="test -c" VIM_VERSION=nvim
1110
- env: ENV=vimlint SCRIPT=lint VIM_VERSION=vim-8.0

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ USER vim-go
1313
COPY . /vim-go/
1414
WORKDIR /vim-go
1515

16-
RUN scripts/install-vim vim-7.4
1716
RUN scripts/install-vim vim-8.0
1817
RUN scripts/install-vim nvim
1918

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VIMS ?= vim-7.4 vim-8.0 nvim
1+
VIMS ?= vim-8.0 nvim
22

33
all: install lint test
44

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This plugin adds Go language support for Vim, with the following main features:
3333

3434
## Install
3535

36-
vim-go requires at least Vim 7.4.2009 or Neovim 0.3.1.
36+
vim-go requires at least Vim 8.0.1542 or Neovim 0.3.1.
3737

3838
The [**latest stable release**](https://github.com/fatih/vim-go/releases/latest) is the
3939
recommended version to use. If you choose to use the master branch instead,

autoload/go/cmd.vim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function! go#cmd#Build(bang, ...) abort
3232
\ map(copy(a:000), "expand(v:val)") +
3333
\ [".", "errors"]
3434

35-
" Vim and Neovim async.
35+
" Vim and Neovim async
3636
if go#util#has_job()
3737
call s:cmd_job({
3838
\ 'cmd': ['go'] + args,
@@ -41,7 +41,7 @@ function! go#cmd#Build(bang, ...) abort
4141
\ 'statustype': 'build'
4242
\})
4343

44-
" Vim 7.4 without async
44+
" Vim without async
4545
else
4646
let default_makeprg = &makeprg
4747
let &makeprg = "go " . join(go#util#Shelllist(args), ' ')
@@ -72,6 +72,7 @@ function! go#cmd#Build(bang, ...) abort
7272
call go#util#EchoSuccess("[build] SUCCESS")
7373
endif
7474
endif
75+
7576
endfunction
7677

7778

autoload/go/coverage.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ endfunction
2525
" the code. Calling it again reruns the tests and shows the last updated
2626
" coverage.
2727
function! go#coverage#Buffer(bang, ...) abort
28-
" we use matchaddpos() which was introduce with 7.4.330, be sure we have
29-
" it: http://ftp.vim.org/vim/patches/7.4/7.4.330
28+
29+
" check if the version of Vim being tested supports matchaddpos()
3030
if !exists("*matchaddpos")
31-
call go#util#EchoError("GoCoverage is supported with Vim version 7.4-330 or later")
31+
call go#util#EchoError("GoCoverage is not supported by your version of Vim.")
3232
return -1
3333
endif
3434

autoload/go/fmt.vim

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,11 @@ function! go#fmt#update_file(source, target)
120120

121121
let l:listtype = go#list#Type("GoFmt")
122122

123-
" the title information was introduced with 7.4-2200
124-
" https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
125-
if has('patch-7.4.2200')
126-
" clean up previous list
127-
if l:listtype == "quickfix"
128-
let l:list_title = getqflist({'title': 1})
129-
else
130-
let l:list_title = getloclist(0, {'title': 1})
131-
endif
123+
" clean up previous list
124+
if l:listtype == "quickfix"
125+
let l:list_title = getqflist({'title': 1})
132126
else
133-
" can't check the title, so assume that the list was for go fmt.
134-
let l:list_title = {'title': 'Format'}
127+
let l:list_title = getloclist(0, {'title': 1})
135128
endif
136129

137130
if has_key(l:list_title, "title") && l:list_title['title'] == "Format"

autoload/go/guru.vim

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,10 @@ function! go#guru#Describe(selected) abort
232232
endfunction
233233

234234
function! go#guru#DescribeInfo(showstatus) abort
235-
" json_encode() and friends are introduced with this patch (7.4.1304)
236-
" vim: https://groups.google.com/d/msg/vim_dev/vLupTNhQhZ8/cDGIk0JEDgAJ
237-
" nvim: https://github.com/neovim/neovim/pull/4131
235+
236+
" check if the version of Vim being tested supports json_decode()
238237
if !exists("*json_decode")
239-
call go#util#EchoError("requires 'json_decode'. Update your Vim/Neovim version.")
238+
call go#util#EchoError("GoDescribeInfo requires 'json_decode'. Update your Vim/Neovim version.")
240239
return
241240
endif
242241

@@ -416,16 +415,14 @@ function! go#guru#Referrers(selected) abort
416415
endfunction
417416

418417
function! go#guru#SameIds(showstatus) abort
419-
" we use matchaddpos() which was introduce with 7.4.330, be sure we have
420-
" it: http://ftp.vim.org/vim/patches/7.4/7.4.330
418+
419+
" check if the version of Vim being tested supports matchaddpos()
421420
if !exists("*matchaddpos")
422421
call go#util#EchoError("GoSameIds requires 'matchaddpos'. Update your Vim/Neovim version.")
423422
return
424423
endif
425424

426-
" json_encode() and friends are introduced with this patch (7.4.1304)
427-
" vim: https://groups.google.com/d/msg/vim_dev/vLupTNhQhZ8/cDGIk0JEDgAJ
428-
" nvim: https://github.com/neovim/neovim/pull/4131
425+
" check if the version of Vim being tested supports json_decode()
429426
if !exists("*json_decode")
430427
call go#util#EchoError("GoSameIds requires 'json_decode'. Update your Vim/Neovim version.")
431428
return
@@ -602,11 +599,9 @@ function! go#guru#DescribeBalloon() abort
602599
return
603600
endif
604601

605-
" json_encode() and friends are introduced with this patch (7.4.1304)
606-
" vim: https://groups.google.com/d/msg/vim_dev/vLupTNhQhZ8/cDGIk0JEDgAJ
607-
" nvim: https://github.com/neovim/neovim/pull/4131
602+
" check if the version of Vim being tested supports json_decode()
608603
if !exists("*json_decode")
609-
call go#util#EchoError("requires 'json_decode'. Update your Vim/Neovim version.")
604+
call go#util#EchoError("GoDescribeBalloon requires 'json_decode'. Update your Vim/Neovim version.")
610605
return
611606
endif
612607

autoload/go/list.vim

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,10 @@ endfunction
4949
function! go#list#Populate(listtype, items, title) abort
5050
if a:listtype == "locationlist"
5151
call setloclist(0, a:items, 'r')
52-
53-
" The last argument ({what}) is introduced with 7.4.2200:
54-
" https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
55-
if has("patch-7.4.2200") | call setloclist(0, [], 'a', {'title': a:title}) | endif
52+
call setloclist(0, [], 'a', {'title': a:title})
5653
else
5754
call setqflist(a:items, 'r')
58-
if has("patch-7.4.2200") | call setqflist([], 'a', {'title': a:title}) | endif
55+
call setqflist([], 'a', {'title': a:title})
5956
endif
6057
endfunction
6158

@@ -80,10 +77,10 @@ endfunction
8077
function! go#list#Parse(listtype, items, title) abort
8178
if a:listtype == "locationlist"
8279
lgetexpr a:items
83-
if has("patch-7.4.2200") | call setloclist(0, [], 'a', {'title': a:title}) | endif
80+
call setloclist(0, [], 'a', {'title': a:title})
8481
else
8582
cgetexpr a:items
86-
if has("patch-7.4.2200") | call setqflist([], 'a', {'title': a:title}) | endif
83+
call setqflist([], 'a', {'title': a:title})
8784
endif
8885
endfunction
8986

autoload/go/mod.vim

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,11 @@ function! go#mod#update_file(source, target)
8383

8484
let l:listtype = go#list#Type("GoModFmt")
8585

86-
" the title information was introduced with 7.4-2200
87-
" https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
88-
if has('patch-7.4.2200')
89-
" clean up previous list
90-
if l:listtype == "quickfix"
91-
let l:list_title = getqflist({'title': 1})
92-
else
93-
let l:list_title = getloclist(0, {'title': 1})
94-
endif
86+
" clean up previous list
87+
if l:listtype == "quickfix"
88+
let l:list_title = getqflist({'title': 1})
9589
else
96-
" can't check the title, so assume that the list was for go fmt.
97-
let l:list_title = {'title': 'Format'}
90+
let l:list_title = getloclist(0, {'title': 1})
9891
endif
9992

10093
if has_key(l:list_title, "title") && l:list_title['title'] == "Format"

doc/vim-go.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ experience.
7777
==============================================================================
7878
INSTALL *go-install*
7979

80-
vim-go requires at least Vim 7.4.2009 or Neovim 0.3.1. On macOS, if you are
80+
vim-go requires at least Vim 8.0.1542 or Neovim 0.3.2. On macOS, if you are
8181
still using your system version of vim, you can use homebrew to keep your
8282
version of Vim up-to-date with the following terminal command:
8383
>
@@ -1202,7 +1202,7 @@ for Vim8 and Neovim.
12021202
*go#complete#GocodeComplete()*
12031203

12041204
Uses `gocode` for autocompletion. By default, it is hooked up to |'omnifunc'|
1205-
for Vim 7.4.
1205+
for Vim 8+.
12061206

12071207
*go#tool#DescribeBalloon()*
12081208

@@ -2427,7 +2427,7 @@ To run tests vim-go comes with three small helper scripts:
24272427
`scripts/test` Run all tests with a Vim from `/tmp/vim-go-test/`.
24282428

24292429
All scripts accept a Vim version as the first argument, which can be
2430-
`vim-7.4`, `vim-8.0`, or `nvim`. You will need to install a Vim version with
2430+
`vim-8.0` or `nvim`. You will need to install a Vim version with
24312431
`install-vim` before you can use `run-vim` or `test`.
24322432

24332433
You can install and test all Vim versions by running `make`.

plugin/go.vim

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,22 @@ let s:cpo_save = &cpo
99
set cpo&vim
1010

1111
function! s:checkVersion() abort
12-
" Not using the has('patch-7.4.2009') syntax because that wasn't added until
13-
" 7.4.237, and we want to be sure this works for everyone (this is also why
14-
" we're not using utils#EchoError()).
15-
"
16-
" Version 7.4.2009 was chosen because that's greater than what the most recent Ubuntu LTS
17-
" release (16.04) uses and has a couple of features we need (e.g. execute()
18-
" and :message clear).
19-
2012
let l:unsupported = 0
2113
if go#config#VersionWarning() != 0
2214
if has('nvim')
2315
let l:unsupported = !has('nvim-0.3.2')
2416
else
25-
let l:unsupported = (v:version < 704 || (v:version == 704 && !has('patch2009')))
17+
let l:unsupported = v:version < 800
2618
endif
2719

2820
if l:unsupported == 1
2921
echohl Error
30-
echom "vim-go requires Vim 7.4.2009 or Neovim 0.3.2, but you're using an older version."
22+
echom "vim-go requires Vim 8+ or Neovim 0.3.2, but you're using an older version."
3123
echom "Please update your Vim for the best vim-go experience."
3224
echom "If you really want to continue you can set this to make the error go away:"
3325
echom " let g:go_version_warning = 0"
3426
echom "Note that some features may error out or behave incorrectly."
35-
echom "Please do not report bugs unless you're using Vim 7.4.2009 or newer or Neovim 0.3.2."
27+
echom "Please do not report bugs unless you're using Vim 8+ or Neovim 0.3.2."
3628
echohl None
3729

3830
" Make sure people see this.

scripts/bench-syntax

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ cd "$vimgodir"
1313

1414
if [ -z "${1:-}" ]; then
1515
echo "unknown version: '${1:-}'"
16-
echo "First argument must be 'vim-7.4', 'vim-8.0', or 'nvim'."
16+
echo "First argument must be 'vim-8.0' or 'nvim'."
1717
exit 1
1818
fi
1919

scripts/install-vim

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ cd "$vimgodir"
1515
vim=${1:-}
1616

1717
case "$vim" in
18-
"vim-7.4")
19-
tag="v7.4.2009"
20-
giturl="https://github.com/vim/vim"
21-
;;
22-
2318
"vim-8.0")
2419
# This follows the version in Arch Linux. Vim's master branch isn't always
2520
# stable, and we don't want to have the build fail because Vim introduced a
@@ -36,7 +31,7 @@ case "$vim" in
3631

3732
*)
3833
echo "unknown version: '${1:-}'"
39-
echo "First argument must be 'vim-7.4', 'vim-8.0', or 'nvim'."
34+
echo "First argument must be 'vim-8.0' or 'nvim'."
4035
exit 1
4136
;;
4237
esac

scripts/lint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ cd "$vimgodir"
1111
#####################################
1212
if [ -z "${1:-}" ]; then
1313
echo "unknown version: '${1:-}'"
14-
echo "First argument must be 'vim-7.4', 'vim-8.0', or 'nvim'."
14+
echo "First argument must be 'vim-8.0' or 'nvim'."
1515
exit 1
1616
fi
1717

scripts/run-vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ shift $((OPTIND - 1))
1717

1818
if [ -z "${1:-}" ]; then
1919
echo "unknown version: '${1:-}'"
20-
echo "First argument must be 'vim-7.4', 'vim-8.0', or 'nvim'."
20+
echo "First argument must be 'vim-8.0' or 'nvim'."
2121
exit 1
2222
fi
2323

scripts/test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ shift $((OPTIND - 1))
4040
#####################################
4141
if [ -z "${1:-}" ]; then
4242
echo "unknown version: '${1:-}'"
43-
echo "First argument must be 'vim-7.4', 'vim-8.0', or 'nvim'."
43+
echo "First argument must be 'vim-8.0' or 'nvim'."
4444
exit 1
4545
fi
4646

0 commit comments

Comments
 (0)