diff --git a/plugin/snipMate.vim b/plugin/snipMate.vim index 1c39e5a..0e9ddb5 100644 --- a/plugin/snipMate.vim +++ b/plugin/snipMate.vim @@ -1,6 +1,6 @@ " File: snipMate.vim " Author: Michael Sanders -" Version: 0.75 +" Version: 0.76 " Description: snipMate.vim implements some of TextMate's snippets features in " Vim. A snippet is a piece of often-typed text that you can " insert into your document using a trigger word followed by a "". @@ -119,15 +119,15 @@ endf fun! TriggerSnippet() if exists('g:SuperTabMappingForward') if g:SuperTabMappingForward == "" - let g:SuperTabKey = "\" + let SuperTabKey = "\" elseif g:SuperTabMappingBackward == "" - let g:SuperTabKey = "\" + let SuperTabKey = "\" endif endif if pumvisible() " Update snippet if completion is used, or deal with supertab - if exists('g:SuperTabKey') - call feedkeys(g:SuperTabKey) | return '' + if exists('SuperTabKey') + call feedkeys(SuperTabKey) | return '' endif call feedkeys("\a", 'n') " Close completion menu call feedkeys("\") | return '' @@ -149,9 +149,11 @@ fun! TriggerSnippet() let col = col('.') - len(trigger) sil exe 's/'.escape(trigger, '.^$/\*[]').'\%#//' return snipMate#expandSnip(col) + elseif exists('SuperTabKey') + call feedkeys(SuperTabKey) + return '' endif - return exists('g:SuperTabKey') && getline('.')[col('.')-2] =~ '\S' - \ ? g:SuperTabKey : "\" + return "\" endf " Check if word under cursor is snippet trigger; if it isn't, try checking if