summaryrefslogtreecommitdiff
path: root/test/completion
diff options
context:
space:
mode:
Diffstat (limited to 'test/completion')
-rw-r--r--test/completion/common.lua5
-rw-r--r--test/completion/init.lua7
2 files changed, 11 insertions, 1 deletions
diff --git a/test/completion/common.lua b/test/completion/common.lua
index bfb987c6..818d0ac5 100644
--- a/test/completion/common.lua
+++ b/test/completion/common.lua
@@ -3074,3 +3074,8 @@ AAA = 1
<??>
]]
(EXISTS)
+
+TEST [[
+if<??>
+]]
+(EXISTS)
diff --git a/test/completion/init.lua b/test/completion/init.lua
index 3d0c4df6..4ae185ca 100644
--- a/test/completion/init.lua
+++ b/test/completion/init.lua
@@ -73,11 +73,16 @@ function TEST(script)
local inputPos = catched['?'][1][2]
if ContinueTyping then
local triggerCharacter = script:sub(inputPos - 1, inputPos - 1)
+ if triggerCharacter == '\n'
+ or triggerCharacter:find '%w_' then
+ triggerCharacter = nil
+ end
core.completion('', inputPos, triggerCharacter)
end
local offset = guide.positionToOffset(state, inputPos)
local triggerCharacter = script:sub(offset, offset)
- if triggerCharacter == '\n' then
+ if triggerCharacter == '\n'
+ or triggerCharacter:find '%w_' then
triggerCharacter = nil
end
local result = core.completion('', inputPos, triggerCharacter)