aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/extmark_spec.lua
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2021-12-08 08:44:48 -0700
committerGitHub <noreply@github.com>2021-12-08 08:44:48 -0700
commitcf32053d6005bb13c41434dea7127713ad46346a (patch)
tree49d4d786334c837791ab6a247caee211bf0b2b48 /test/functional/api/extmark_spec.lua
parent5abd7c2c1487976f538ce510b06497fffd7e5252 (diff)
downloadrneovim-cf32053d6005bb13c41434dea7127713ad46346a.tar.gz
rneovim-cf32053d6005bb13c41434dea7127713ad46346a.tar.bz2
rneovim-cf32053d6005bb13c41434dea7127713ad46346a.zip
fix(api): allow nvim_buf_set_extmark to accept end_row key (#16548)
nvim_buf_get_extmark uses "end_row" rather than "end_line" in its 'details' dict, which means callers must modify the key names if they want to re-use the information. Change the parameter name in nvim_buf_set_extmark to "end_row" and use "end_line" as an alias to make this more consistent.
Diffstat (limited to 'test/functional/api/extmark_spec.lua')
-rw-r--r--test/functional/api/extmark_spec.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/functional/api/extmark_spec.lua b/test/functional/api/extmark_spec.lua
index 50b4b85d2a..45a01be620 100644
--- a/test/functional/api/extmark_spec.lua
+++ b/test/functional/api/extmark_spec.lua
@@ -104,10 +104,10 @@ describe('API/extmarks', function()
it("can end extranges past final newline using end_col = 0", function()
set_extmark(ns, marks[1], 0, 0, {
end_col = 0,
- end_line = 1
+ end_row = 1
})
eq("end_col value outside range",
- pcall_err(set_extmark, ns, marks[2], 0, 0, { end_col = 1, end_line = 1 }))
+ pcall_err(set_extmark, ns, marks[2], 0, 0, { end_col = 1, end_row = 1 }))
end)
it('adds, updates and deletes marks', function()
@@ -1424,6 +1424,14 @@ describe('API/extmarks', function()
eq({ {1, 0, 0}, {2, 0, 8} },
meths.buf_get_extmarks(0, ns, 0, -1, {}))
end)
+
+ it('can accept "end_row" or "end_line" #16548', function()
+ set_extmark(ns, marks[1], 0, 0, {
+ end_col = 0,
+ end_line = 1
+ })
+ eq({ {1, 0, 0, { end_col = 0, end_row = 1 }} }, get_extmarks(ns, 0, -1, {details=true}))
+ end)
end)
describe('Extmarks buffer api with many marks', function()