aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/vim_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-11-21 14:25:45 +0800
committerGitHub <noreply@github.com>2023-11-21 14:25:45 +0800
commitfec5e3ab247bcc1ced67f1d0aa7fa10f694f933b (patch)
treea869106aa7bd8fd6fae1d0315e9a1e46bfae10d8 /test/functional/lua/vim_spec.lua
parent488038580934f301c1528a14548ec0cabd16c2cd (diff)
downloadrneovim-fec5e3ab247bcc1ced67f1d0aa7fa10f694f933b.tar.gz
rneovim-fec5e3ab247bcc1ced67f1d0aa7fa10f694f933b.tar.bz2
rneovim-fec5e3ab247bcc1ced67f1d0aa7fa10f694f933b.zip
fix(vim.region): handle multibyte inclusive selection properly (#26129)
Diffstat (limited to 'test/functional/lua/vim_spec.lua')
-rw-r--r--test/functional/lua/vim_spec.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua
index a8a72f20c9..1533a1823f 100644
--- a/test/functional/lua/vim_spec.lua
+++ b/test/functional/lua/vim_spec.lua
@@ -2395,7 +2395,14 @@ describe('lua stdlib', function()
text tαxt txtα tex
text tαxt tαxt
]]))
- eq({5,15}, exec_lua[[ return vim.region(0,{1,5},{1,14},'v',true)[1] ]])
+ eq({5,13}, exec_lua[[ return vim.region(0,{0,5},{0,13},'v',false)[0] ]])
+ eq({5,15}, exec_lua[[ return vim.region(0,{0,5},{0,13},'v',true)[0] ]])
+ eq({5,15}, exec_lua[[ return vim.region(0,{0,5},{0,14},'v',true)[0] ]])
+ eq({5,15}, exec_lua[[ return vim.region(0,{0,5},{0,15},'v',false)[0] ]])
+ eq({5,17}, exec_lua[[ return vim.region(0,{0,5},{0,15},'v',true)[0] ]])
+ eq({5,17}, exec_lua[[ return vim.region(0,{0,5},{0,16},'v',true)[0] ]])
+ eq({5,17}, exec_lua[[ return vim.region(0,{0,5},{0,17},'v',false)[0] ]])
+ eq({5,18}, exec_lua[[ return vim.region(0,{0,5},{0,17},'v',true)[0] ]])
end)
it('blockwise', function()
insert([[αα]])