Skip to content

Commit

Permalink
Merge pull request #750 from nfnty/master
Browse files Browse the repository at this point in the history
Use mapping independent `normal!`
  • Loading branch information
fatih committed Mar 13, 2016
2 parents 1f7e9b4 + 1b1c80b commit 6fd09db
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion autoload/go/def.vim
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function! s:godefJump(out, mode)

" jump to file now
sil ll 1
normal zz
normal! zz

let &switchbuf = old_switchbuf
end
Expand Down
10 changes: 5 additions & 5 deletions autoload/go/doc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -113,28 +113,28 @@ function! go#doc#Open(newmode, mode, ...)
call s:GodocView(a:newmode, a:mode, content)

if exported_name == ''
silent! normal gg
silent! normal! gg
return -1
endif

" jump to the specified name
if search('^func ' . exported_name . '(')
silent! normal zt
silent! normal! zt
return -1
endif

if search('^type ' . exported_name)
silent! normal zt
silent! normal! zt
return -1
endif

if search('^\%(const\|var\|type\|\s\+\) ' . pkg . '\s\+=\s')
silent! normal zt
silent! normal! zt
return -1
endif

" nothing found, jump to top
silent! normal gg
silent! normal! gg
endfunction

function! s:GodocView(newposition, position, content)
Expand Down
2 changes: 1 addition & 1 deletion autoload/go/import.vim
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function! go#import#SwitchImport(enabled, localname, path, bang)
call append(appendline, appendstr)
execute appendline + 1
if indentstr
execute 'normal >>'
execute 'normal! >>'
endif
let linesdelta += 1
endif
Expand Down

0 comments on commit 6fd09db

Please sign in to comment.