diff --git a/plugin/supertab.vim b/plugin/supertab.vim index 8b7d7bb..1e9f5b9 100644 --- a/plugin/supertab.vim +++ b/plugin/supertab.vim @@ -2,7 +2,7 @@ " Original: Gergely Kontra " Current: Eric Van Dewoestine (as of version 0.4) " Please direct all correspondence to Eric. -" Version: 1.5 +" Version: 1.6 " GetLatestVimScripts: 1643 1 :AutoInstall: supertab.vim " " Description: {{{ @@ -325,12 +325,6 @@ function! s:SuperTab(command) call s:EnableLongestEnhancement() endif - " highlight first result if longest enabled - if g:SuperTabLongestHighlight && !pumvisible() && &completeopt =~ 'longest' - let key = (b:complType == "\") ? b:complType : "\" - call feedkeys(key) - endif - if !pumvisible() let b:complTypeManual = '' endif @@ -386,6 +380,14 @@ function! s:SuperTab(command) let complType = b:complType endif + " highlight first result if longest enabled + if g:SuperTabLongestHighlight && + \ &completeopt =~ 'longest' && + \ (!pumvisible() || b:complReset) + let key = (complType == "\") ? "\" : "\" + call feedkeys(key, 'n') + endif + if b:complReset let b:complReset = 0 " not an accurate condition for everyone, but better than sending