merged with upstream

This commit is contained in:
rygwdn@gmail.com 2010-07-29 23:11:46 -03:00
commit d6c174e9df
3 changed files with 41 additions and 5 deletions

View File

@ -594,15 +594,20 @@ individuals have contributed code to UltiSnips. In order of apperance.
8.1 Patches & Coding *UltiSnips-contricoding*
--------------------
JCEB - Jan Christoph Ebersbach
Michael Henry
Ryan Wooden
Contributers are listed in chronological order:
JCEB - Jan Christoph Ebersbach
Michael Henry
Chris Chambers
Ryan Wooden
8.2 Snippets *UltiSnips-contrisnippets*
------------
Alec Thomas (Python, smart def)
Ryan Wooden
Contributers are listed in chronological order:
Alec Thomas (Python, smart def)
Ryan Wooden

View File

@ -40,12 +40,23 @@ endif
" }}}
"" FUNCTIONS {{{
function! CompensateForPUM()
""" The CursorMovedI event is not triggered while the popup-menu is visible,
""" and it's by this event that UltiSnips updates its vim-state. The fix is
""" to explicitly check for the presence of the popup menu, and update
""" the vim-state accordingly.
if pumvisible()
py UltiSnips_Manager.cursor_moved()
endif
endfunction
function! UltiSnips_ExpandSnippet()
py UltiSnips_Manager.expand()
return ""
endfunction
function! UltiSnips_ExpandSnippetOrJump()
call CompensateForPUM()
py UltiSnips_Manager.expand_or_jump()
return ""
endfunction
@ -56,11 +67,13 @@ function! UltiSnips_ListSnippets()
endfunction
function! UltiSnips_JumpBackwards()
call CompensateForPUM()
py UltiSnips_Manager.jump_backwards()
return ""
endfunction
function! UltiSnips_JumpForwards()
call CompensateForPUM()
py UltiSnips_Manager.jump_forwards()
return ""
endfunction

18
test.py
View File

@ -1322,6 +1322,24 @@ class Completion_SimpleExample_ECR(_VimTest):
wanted = "superkallifragilistik\nsuperkallifragilistik some more " \
"superkallifragilistik some more"
# We need >2 different words with identical starts to create the
# popup-menu:
COMPLETION_OPTIONS = "completion1\ncompletion2\n"
class Completion_ForwardsJumpWithoutCOMPL_ACCEPT(_VimTest):
# completions should not be truncated when JF is activated without having
# pressed COMPL_ACCEPT (Bug #598903)
snippets = ("test", "$1 $2")
keys = COMPLETION_OPTIONS + "test" + EX + "com" + COMPL_KW + JF + "foo"
wanted = COMPLETION_OPTIONS + "completion1 foo"
class Completion_BackwardsJumpWithoutCOMPL_ACCEPT(_VimTest):
# completions should not be truncated when JB is activated without having
# pressed COMPL_ACCEPT (Bug #598903)
snippets = ("test", "$1 $2")
keys = COMPLETION_OPTIONS + "test" + EX + "foo" + JF + "com" + COMPL_KW + \
JB + "foo"
wanted = COMPLETION_OPTIONS + "foo completion1"
###################
# SNIPPET OPTIONS #