priority test, docs & fmt fixes
This commit is contained in:
parent
904fbdecf5
commit
1b3ecf4a85
@ -1333,10 +1333,8 @@ endsnippet
|
||||
That snippet will expand to 'return err' only if the previous line is starting
|
||||
from 'if err' prefix.
|
||||
|
||||
Note: context snippets prioritized over non-context ones. So, if there are
|
||||
two snippets with the same trigger, and one of them is context snippet and
|
||||
it's expression evaluates to 'True', then context snippet will be used for
|
||||
expansion and first will be ignored.
|
||||
Note: context snippets prioritized over non-context ones. It makes possible to
|
||||
use non-context snippets as fallback, if no context matched:
|
||||
|
||||
------------------- SNIP -------------------
|
||||
snippet i "if ..." b
|
||||
|
@ -85,3 +85,19 @@ class ContextSnippets_SnippetPriority(_VimTest):
|
||||
if true {
|
||||
// pass
|
||||
}"""
|
||||
|
||||
|
||||
class ContextSnippets_PriorityKeyword(_VimTest):
|
||||
files = { 'us/all.snippets': r"""
|
||||
snippet i "desc" "True" e
|
||||
a
|
||||
endsnippet
|
||||
|
||||
priority 100
|
||||
snippet i
|
||||
b
|
||||
endsnippet
|
||||
"""}
|
||||
|
||||
keys = "i" + EX
|
||||
wanted = "b"
|
||||
|
@ -159,7 +159,8 @@ class MySnippetSource(SnippetSource):
|
||||
if before.endswith('blumba'):
|
||||
return [
|
||||
UltiSnipsSnippetDefinition(
|
||||
-100, "blumba", "this is a dynamic snippet", "", "", {}, "blub", None)
|
||||
-100, "blumba", "this is a dynamic snippet", "", "", {}, "blub",
|
||||
None)
|
||||
]
|
||||
return []
|
||||
""")
|
||||
|
Loading…
Reference in New Issue
Block a user