Skip to content

Commit aa8b134

Browse files
authored
Merge pull request #2021 from bhcleek/fix-godoc-arrow
don't close godoc scratch with arrow keys
2 parents 620e8ac + 08993d7 commit aa8b134

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

autoload/go/doc.vim

+4-1
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,12 @@ function! s:GodocView(newposition, position, content) abort
122122
setlocal nomodifiable
123123
sil normal! gg
124124

125-
" close easily with <esc> or enter
125+
" close easily with enter
126126
noremap <buffer> <silent> <CR> :<C-U>close<CR>
127127
noremap <buffer> <silent> <Esc> :<C-U>close<CR>
128+
" make sure any key that sends an escape as a prefix (e.g. the arrow keys)
129+
" don't cause the window to close.
130+
nnoremap <buffer> <silent> <Esc>[ <Esc>[
128131
endfunction
129132

130133
function! s:gogetdoc(json) abort

0 commit comments

Comments
 (0)