From e026bebf1b7113319fc7831bc72d0fb6e49bd087 Mon Sep 17 00:00:00 2001 From: ervandew Date: Wed, 9 Mar 2011 07:17:31 -0800 Subject: [PATCH] fix longest highlight to use / + to work properly w/ longest enhanced --- plugin/supertab.vim | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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