merged with upstream
This commit is contained in:
commit
d6c174e9df
@ -594,15 +594,20 @@ individuals have contributed code to UltiSnips. In order of apperance.
|
|||||||
8.1 Patches & Coding *UltiSnips-contricoding*
|
8.1 Patches & Coding *UltiSnips-contricoding*
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
JCEB - Jan Christoph Ebersbach
|
Contributers are listed in chronological order:
|
||||||
Michael Henry
|
|
||||||
Ryan Wooden
|
JCEB - Jan Christoph Ebersbach
|
||||||
|
Michael Henry
|
||||||
|
Chris Chambers
|
||||||
|
Ryan Wooden
|
||||||
|
|
||||||
8.2 Snippets *UltiSnips-contrisnippets*
|
8.2 Snippets *UltiSnips-contrisnippets*
|
||||||
------------
|
------------
|
||||||
|
|
||||||
Alec Thomas (Python, smart def)
|
Contributers are listed in chronological order:
|
||||||
Ryan Wooden
|
|
||||||
|
Alec Thomas (Python, smart def)
|
||||||
|
Ryan Wooden
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,12 +40,23 @@ endif
|
|||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
"" FUNCTIONS {{{
|
"" 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()
|
function! UltiSnips_ExpandSnippet()
|
||||||
py UltiSnips_Manager.expand()
|
py UltiSnips_Manager.expand()
|
||||||
return ""
|
return ""
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! UltiSnips_ExpandSnippetOrJump()
|
function! UltiSnips_ExpandSnippetOrJump()
|
||||||
|
call CompensateForPUM()
|
||||||
py UltiSnips_Manager.expand_or_jump()
|
py UltiSnips_Manager.expand_or_jump()
|
||||||
return ""
|
return ""
|
||||||
endfunction
|
endfunction
|
||||||
@ -56,11 +67,13 @@ function! UltiSnips_ListSnippets()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! UltiSnips_JumpBackwards()
|
function! UltiSnips_JumpBackwards()
|
||||||
|
call CompensateForPUM()
|
||||||
py UltiSnips_Manager.jump_backwards()
|
py UltiSnips_Manager.jump_backwards()
|
||||||
return ""
|
return ""
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! UltiSnips_JumpForwards()
|
function! UltiSnips_JumpForwards()
|
||||||
|
call CompensateForPUM()
|
||||||
py UltiSnips_Manager.jump_forwards()
|
py UltiSnips_Manager.jump_forwards()
|
||||||
return ""
|
return ""
|
||||||
endfunction
|
endfunction
|
||||||
|
18
test.py
18
test.py
@ -1322,6 +1322,24 @@ class Completion_SimpleExample_ECR(_VimTest):
|
|||||||
wanted = "superkallifragilistik\nsuperkallifragilistik some more " \
|
wanted = "superkallifragilistik\nsuperkallifragilistik some more " \
|
||||||
"superkallifragilistik 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 #
|
# SNIPPET OPTIONS #
|
||||||
|
Loading…
x
Reference in New Issue
Block a user