aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-07-06 22:25:35 +0800
committerGitHub <noreply@github.com>2024-07-06 22:25:35 +0800
commitbdc6e38781321895331057cbcfb099f8ad31e6db (patch)
tree94df4cf7cae8e7b347f798e7435fc55845d66d03 /test/functional
parent34fa54355a50baefe443a00ec4b0d60188445b36 (diff)
downloadrneovim-bdc6e38781321895331057cbcfb099f8ad31e6db.tar.gz
rneovim-bdc6e38781321895331057cbcfb099f8ad31e6db.tar.bz2
rneovim-bdc6e38781321895331057cbcfb099f8ad31e6db.zip
fix(lua): don't include text after cursor in completion pattern (#29587)
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/editor/completion_spec.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/editor/completion_spec.lua b/test/functional/editor/completion_spec.lua
index 405af5fcfd..9d5bda0acc 100644
--- a/test/functional/editor/completion_spec.lua
+++ b/test/functional/editor/completion_spec.lua
@@ -854,6 +854,16 @@ describe('completion', function()
]])
end)
+ it('works when cursor is in the middle of cmdline #29586', function()
+ feed(':lua math.a(); 1<Left><Left><Left><Left><Left><Tab>')
+ screen:expect([[
+ |
+ {1:~ }|*5
+ {100:abs}{3: acos asin atan atan2 }|
+ :lua math.abs^(); 1 |
+ ]])
+ end)
+
it('provides completion from `getcompletion()`', function()
eq({ 'vim' }, fn.getcompletion('vi', 'lua'))
eq({ 'api' }, fn.getcompletion('vim.ap', 'lua'))