diff --git a/bundle/gtags.vim/autoload/gtags.vim b/bundle/gtags.vim/autoload/gtags.vim index cb0d4697a..16a2836d8 100644 --- a/bundle/gtags.vim/autoload/gtags.vim +++ b/bundle/gtags.vim/autoload/gtags.vim @@ -23,10 +23,6 @@ let g:gtags_global_command = get(g:, 'gtags_global_command', \ empty($GTAGSGLOBAL) ? 'global' : $GTAGSGLOBAL \ ) -"" -" Enable/Disable default mappings. By default it is disabled. -let g:gtags_auto_map = get(g:, 'gtags_auto_map', 0) - "" " This setting will open the |quickfix| list when adding entries. A value of 2 will " preserve the cursor position when the |quickfix| window is @@ -308,12 +304,15 @@ function! s:ExecLoad(option, long_option, pattern) abort " Parse the output of 'global -x or -t' and show in the quickfix window. let l:efm_org = &efm let &efm = g:Gtags_Efm - if l:result =~# '\n.' - cgetexpr l:result - else - cexpr! l:result - endif + + cgetexpr l:result + let &efm = l:efm_org + + " If there is only one item, jump to the position. + if len(getqflist()) ==# 1 + cnext + endif endfunction let s:prev_windows = [] diff --git a/bundle/gtags.vim/doc/gtags.txt b/bundle/gtags.vim/doc/gtags.txt index 3a05917cf..fd7d9b8cd 100644 --- a/bundle/gtags.vim/doc/gtags.txt +++ b/bundle/gtags.vim/doc/gtags.txt @@ -20,9 +20,6 @@ CONFIGURATION *gtags-config* Set the global command name. If it is not set, will use $GTAGSGLOBAL, and if $GTAGSGLOBAL still is an empty string, then will use 'global'. - *g:gtags_auto_map* -Enable/Disable default mappings. By default it is disabled. - *g:gtags_open_list* This setting will open the |quickfix| list when adding entries. A value of 2 will preserve the cursor position when the |quickfix| window is opened.