Skip to content

Commit 26107fe

Browse files
committed
vim74-kaoriya-win64-20140202
1 parent d6fd4af commit 26107fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+690
-546
lines changed

CHANGES_kaoriya.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
=== 20140202�̕ύX�_ ===
2+
3+
* �x�[�X�R�[�h��7.4.161�ɍX�V���܂���
4+
* �R���p�C�����Ɏg�p����Perl��5.18.1�ɃA�b�v�f�[�g���܂���
5+
* �R���p�C�����Ɏg�p����Ruby��2.0.0-p353�ɃA�b�v�f�[�g���܂���
6+
* contrib�X�V
7+
* vimdoc-ja��(2014-02-02 95b030a)�ɍX�V���܂���
8+
* vimproc��(2014-01-17 11bd685)�ɍX�V���܂���
9+
* LuaJIT��(2014-02-01 b20ff7a)�ɍX�V���܂���
10+
* plugins/golang��go-1.2�ɍX�V���܂���
11+
112
=== 20131117�̕ύX�_ ===
213

314
* �x�[�X�R�[�h��7.4.092�ɍX�V���܂���

README_kaoriya.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Version: 1.7.5
44
Author: MURAOKA Taro
55
Since: 23-Aug-1999
6-
Last Change: 10-Aug-2013.
6+
Last Change: 02-Feb-2014.
77

88
�T�v
99
Vim��vi�N���[���ɕ��ނ����e�L�X�g�G�f�B�^�ł��B
@@ -71,7 +71,7 @@ Vim
7171
Perl(ActivePerl)�Ƃ̘A�g
7272
����: Perl���C���X�g�[�����Ȃ��Ă�Vim�͎g�p�ł��܂��B
7373

74-
ActiveState�Ђɂ����J����Ă���ActivePerl 5.16���C���X�g�[�����邱�ƂŁA
74+
ActiveState�Ђɂ����J����Ă���ActivePerl 5.18���C���X�g�[�����邱�ƂŁA
7575
Perl�C���^�[�t�F�[�X���g�p���邱�Ƃ��ł��܂��BActivePerl���C���X�g�[������
7676
���Ȃ��ꍇ�́APerl�C���^�[�t�F�[�X�͎����I�ɖ����ƂȂ�܂��BPerl�C���^�[
7777
�t�F�[�X�̏ڍׂɂ‚��Ă�":help perl"�Ƃ���Vim�t���̃}�j���A�����Q�Ƃ��Ă�

plugins/golang/autoload/go/complete.vim

Lines changed: 51 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,43 +28,75 @@ if len(s:goarch) == 0
2828
endif
2929
endif
3030

31+
function! go#complete#PackageMembers(package, member)
32+
silent! let content = system('godoc ' . a:package)
33+
if v:shell_error || !len(content)
34+
return []
35+
endif
36+
let lines = filter(split(content, "\n"),"v:val !~ '^\\s\\+$'")
37+
try
38+
let mx1 = '^\s\+\(\S+\)\s\+=\s\+.*'
39+
let mx2 = '^\%(const\|var\|type\|func\) \([A-Z][^ (]\+\).*'
40+
let candidates =
41+
\ map(filter(copy(lines), 'v:val =~ mx1'), 'substitute(v:val, mx1, "\\1", "")')
42+
\ + map(filter(copy(lines), 'v:val =~ mx2'), 'substitute(v:val, mx2, "\\1", "")')
43+
return filter(candidates, '!stridx(v:val, a:member)')
44+
catch
45+
return []
46+
endtry
47+
endfunction
48+
3149
function! go#complete#Package(ArgLead, CmdLine, CursorPos)
3250
let dirs = []
3351

52+
let words = split(a:CmdLine, '\s\+', 1)
53+
if len(words) > 2
54+
" Complete package members
55+
return go#complete#PackageMembers(words[1], words[2])
56+
endif
57+
3458
if executable('go')
35-
let goroot = substitute(system('go env GOROOT'), '\n', '', 'g')
36-
if v:shell_error
37-
echo '\'go env GOROOT\' failed'
38-
endif
59+
let goroot = substitute(system('go env GOROOT'), '\n', '', 'g')
60+
if v:shell_error
61+
echomsg '\'go env GOROOT\' failed'
62+
endif
3963
else
40-
let goroot = $GOROOT
64+
let goroot = $GOROOT
4165
endif
4266

4367
if len(goroot) != 0 && isdirectory(goroot)
44-
let dirs += [ goroot ]
68+
let dirs += [goroot]
4569
endif
4670

47-
let workspaces = split($GOPATH, ':')
71+
let pathsep = ':'
72+
if s:goos == 'windows'
73+
let pathsep = ';'
74+
endif
75+
let workspaces = split($GOPATH, pathsep)
4876
if workspaces != []
49-
let dirs += workspaces
77+
let dirs += workspaces
5078
endif
5179

5280
if len(dirs) == 0
53-
" should not happen
54-
return []
81+
" should not happen
82+
return []
5583
endif
5684

5785
let ret = {}
5886
for dir in dirs
59-
let root = expand(dir . '/pkg/' . s:goos . '_' . s:goarch)
60-
for i in split(globpath(root, a:ArgLead.'*'), "\n")
61-
if isdirectory(i)
62-
let i .= '/'
63-
elseif i !~ '\.a$'
64-
continue
65-
endif
66-
let i = substitute(substitute(i[len(root)+1:], '[\\]', '/', 'g'), '\.a$', '', 'g')
67-
let ret[i] = i
87+
" this may expand to multiple lines
88+
let root = split(expand(dir . '/pkg/' . s:goos . '_' . s:goarch), "\n")
89+
call add(root, expand(dir . '/src'))
90+
for r in root
91+
for i in split(globpath(r, a:ArgLead.'*'), "\n")
92+
if isdirectory(i)
93+
let i .= '/'
94+
elseif i !~ '\.a$'
95+
continue
96+
endif
97+
let i = substitute(substitute(i[len(r)+1:], '[\\]', '/', 'g'), '\.a$', '', 'g')
98+
let ret[i] = i
99+
endfor
68100
endfor
69101
endfor
70102
return sort(keys(ret))

plugins/golang/compiler/go.vim

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
" Copyright 2013 The Go Authors. All rights reserved.
2+
" Use of this source code is governed by a BSD-style
3+
" license that can be found in the LICENSE file.
4+
"
5+
" compiler/go.vim: Vim compiler file for Go.
6+
7+
if exists("current_compiler")
8+
finish
9+
endif
10+
let current_compiler = "go"
11+
12+
if exists(":CompilerSet") != 2
13+
command -nargs=* CompilerSet setlocal <args>
14+
endif
15+
16+
let s:save_cpo = &cpo
17+
set cpo-=C
18+
19+
CompilerSet makeprg=go\ build
20+
CompilerSet errorformat=
21+
\%-G#\ %.%#,
22+
\%A%f:%l:%c:\ %m,
23+
\%A%f:%l:\ %m,
24+
\%C%*\\s%m,
25+
\%-G%.%#
26+
27+
let &cpo = s:save_cpo
28+
unlet s:save_cpo
29+
30+
" vim:ts=4:sw=4:et

plugins/golang/ftplugin/go.vim

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
" Copyright 2013 The Go Authors. All rights reserved.
2+
" Use of this source code is governed by a BSD-style
3+
" license that can be found in the LICENSE file.
4+
"
5+
" go.vim: Vim filetype plugin for Go.
6+
7+
if exists("b:did_ftplugin")
8+
finish
9+
endif
10+
let b:did_ftplugin = 1
11+
12+
setlocal comments=s1:/*,mb:*,ex:*/,://
13+
setlocal commentstring=//\ %s
14+
15+
let b:undo_ftplugin = "setl com< cms<"
16+
17+
" vim:ts=4:sw=4:et

plugins/golang/ftplugin/go/fmt.vim

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,35 @@
1212
" It tries to preserve cursor position and avoids
1313
" replacing the buffer with stderr output.
1414
"
15+
" Options:
16+
"
17+
" g:go_fmt_commands [default=1]
18+
"
19+
" Flag to indicate whether to enable the commands listed above.
20+
"
21+
" g:gofmt_command [default="gofmt"]
22+
"
23+
" Flag naming the gofmt executable to use.
24+
"
1525
if exists("b:did_ftplugin_go_fmt")
1626
finish
1727
endif
1828

19-
command! -buffer Fmt call s:GoFormat()
29+
if !exists("g:go_fmt_commands")
30+
let g:go_fmt_commands = 1
31+
endif
32+
33+
if !exists("g:gofmt_command")
34+
let g:gofmt_command = "gofmt"
35+
endif
36+
37+
if g:go_fmt_commands
38+
command! -buffer Fmt call s:GoFormat()
39+
endif
2040

2141
function! s:GoFormat()
2242
let view = winsaveview()
23-
silent %!gofmt
43+
silent execute "%!" . g:gofmt_command
2444
if v:shell_error
2545
let errors = []
2646
for line in getline(1, line('$'))

plugins/golang/ftplugin/go/import.vim

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,40 @@
2424
" imported, an error will be displayed and the buffer will be
2525
" untouched.
2626
"
27-
" In addition to these commands, there are also two shortcuts mapped:
27+
" If you would like to add shortcuts, you can do so by doing the following:
2828
"
29-
" \f - Runs :Import fmt
30-
" \F - Runs :Drop fmt
29+
" Import fmt
30+
" au Filetype go nnoremap <buffer> <LocalLeader>f :Import fmt<CR>
3131
"
32-
" The backslash is the default maplocalleader, so it is possible that
32+
" Drop fmt
33+
" au Filetype go nnoremap <buffer> <LocalLeader>F :Drop fmt<CR>
34+
"
35+
" Import the word under your cursor
36+
" au Filetype go nnoremap <buffer> <LocalLeader>k
37+
" \ :exe 'Import ' . expand('<cword>')<CR>
38+
"
39+
" The backslash '\' is the default maplocalleader, so it is possible that
3340
" your vim is set to use a different character (:help maplocalleader).
3441
"
42+
" Options:
43+
"
44+
" g:go_import_commands [default=1]
45+
"
46+
" Flag to indicate whether to enable the commands listed above.
47+
"
3548
if exists("b:did_ftplugin_go_import")
3649
finish
3750
endif
3851

39-
command! -buffer -nargs=? -complete=customlist,go#complete#Package Drop call s:SwitchImport(0, '', <f-args>)
40-
command! -buffer -nargs=1 -complete=customlist,go#complete#Package Import call s:SwitchImport(1, '', <f-args>)
41-
command! -buffer -nargs=* -complete=customlist,go#complete#Package ImportAs call s:SwitchImport(1, <f-args>)
42-
map <buffer> <LocalLeader>f :Import fmt<CR>
43-
map <buffer> <LocalLeader>F :Drop fmt<CR>
52+
if !exists("g:go_import_commands")
53+
let g:go_import_commands = 1
54+
endif
55+
56+
if g:go_import_commands
57+
command! -buffer -nargs=? -complete=customlist,go#complete#Package Drop call s:SwitchImport(0, '', <f-args>)
58+
command! -buffer -nargs=1 -complete=customlist,go#complete#Package Import call s:SwitchImport(1, '', <f-args>)
59+
command! -buffer -nargs=* -complete=customlist,go#complete#Package ImportAs call s:SwitchImport(1, <f-args>)
60+
endif
4461

4562
function! s:SwitchImport(enabled, localname, path)
4663
let view = winsaveview()

plugins/golang/ftplugin/go/test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ test_one() {
2929
vim -e -s -u /dev/null -U /dev/null --noplugin -c "source import.vim" \
3030
-c "$1" -c 'wq! test.go' base.go
3131
# ensure blank lines are treated correctly
32-
if ! gofmt test.go | cmp test.go; then
32+
if ! gofmt test.go | cmp test.go -; then
3333
echo 2>&1 "gofmt conflict"
3434
gofmt test.go | diff -u test.go - | sed "s/^/ /" 2>&1
3535
fail=1
3636
return
3737
fi
38-
if ! grep -P -q "(?s)$2" test.go; then
38+
if ! [[ $(cat test.go) =~ $2 ]]; then
3939
echo 2>&1 "$2 did not match"
4040
cat test.go | sed "s/^/ /" 2>&1
4141
fail=1

0 commit comments

Comments
 (0)