aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/extmark_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-12-25 15:50:58 +0800
committerGitHub <noreply@github.com>2023-12-25 15:50:58 +0800
commita42df117861f0f0233dec89a0d2cc79144d4fa4e (patch)
tree443d9f133fe77439a0a5db71250cf6e624f3b7c4 /test/functional/api/extmark_spec.lua
parent2877672d70e76f71ae1190090b8aea7044d458be (diff)
downloadrneovim-a42df117861f0f0233dec89a0d2cc79144d4fa4e.tar.gz
rneovim-a42df117861f0f0233dec89a0d2cc79144d4fa4e.tar.bz2
rneovim-a42df117861f0f0233dec89a0d2cc79144d4fa4e.zip
test(extmarks): improve tests for ui_watched (#26732)
Diffstat (limited to 'test/functional/api/extmark_spec.lua')
-rw-r--r--test/functional/api/extmark_spec.lua58
1 files changed, 34 insertions, 24 deletions
diff --git a/test/functional/api/extmark_spec.lua b/test/functional/api/extmark_spec.lua
index facabee7a4..9b8d8a3afc 100644
--- a/test/functional/api/extmark_spec.lua
+++ b/test/functional/api/extmark_spec.lua
@@ -1807,7 +1807,7 @@ describe('API/win_extmark', function()
extmarks = {
[2] = {
-- positioned at the end of the 2nd line
- { {id = 1000}, 1, 1, 1, 16 },
+ { {id = 1000}, ns, marks[1], 1, 16 },
}
},
})
@@ -1816,6 +1816,7 @@ describe('API/win_extmark', function()
it('sends multiple ui-watched marks to ui', function()
screen = Screen.new(20, 4)
screen:attach()
+ feed('15A!<Esc>')
-- should send all of these
set_extmark(ns, marks[1], 1, 0, { ui_watched = true, virt_text_pos = "overlay" })
set_extmark(ns, marks[2], 1, 2, { ui_watched = true, virt_text_pos = "overlay" })
@@ -1825,25 +1826,34 @@ describe('API/win_extmark', function()
screen:expect({
grid = [[
non ui-watched line |
- ui-watched lin^e |
- ~ |
+ ui-watched line!!!!!|
+ !!!!!!!!!^! |
|
]],
extmarks = {
[2] = {
- -- earlier notifications
- { {id = 1000}, 1, 1, 1, 0 },
- { {id = 1000}, 1, 1, 1, 0 }, { {id = 1000}, 1, 2, 1, 2 },
- { {id = 1000}, 1, 1, 1, 0 }, { {id = 1000}, 1, 2, 1, 2 }, { {id = 1000}, 1, 3, 1, 4 },
- { {id = 1000}, 1, 1, 1, 0 }, { {id = 1000}, 1, 2, 1, 2 }, { {id = 1000}, 1, 3, 1, 4 }, { {id = 1000}, 1, 4, 1, 6 },
+ -- notification from 1st call
+ { {id = 1000}, ns, marks[1], 1, 0 },
+ -- notifications from 2nd call
+ { {id = 1000}, ns, marks[1], 1, 0 },
+ { {id = 1000}, ns, marks[2], 1, 2 },
+ -- notifications from 3nd call
+ { {id = 1000}, ns, marks[1], 1, 0 },
+ { {id = 1000}, ns, marks[2], 1, 2 },
+ { {id = 1000}, ns, marks[3], 1, 4 },
+ -- notifications from 4th call
+ { {id = 1000}, ns, marks[1], 1, 0 },
+ { {id = 1000}, ns, marks[2], 1, 2 },
+ { {id = 1000}, ns, marks[3], 1, 4 },
+ { {id = 1000}, ns, marks[4], 1, 6 },
-- final
-- overlay
- { {id = 1000}, 1, 1, 1, 0 },
- { {id = 1000}, 1, 2, 1, 2 },
- { {id = 1000}, 1, 3, 1, 4 },
- { {id = 1000}, 1, 4, 1, 6 },
+ { {id = 1000}, ns, marks[1], 1, 0 },
+ { {id = 1000}, ns, marks[2], 1, 2 },
+ { {id = 1000}, ns, marks[3], 1, 4 },
+ { {id = 1000}, ns, marks[4], 1, 6 },
-- eol
- { {id = 1000}, 1, 5, 1, 16 },
+ { {id = 1000}, ns, marks[5], 2, 11 },
}
},
})
@@ -1868,9 +1878,9 @@ describe('API/win_extmark', function()
extmarks = {
[2] = {
-- positioned at the end of the 2nd line
- { {id = 1000}, 1, 1, 1, 16 },
+ { {id = 1000}, ns, marks[1], 1, 16 },
-- updated and wrapped to 3rd line
- { {id = 1000}, 1, 1, 2, 2 },
+ { {id = 1000}, ns, marks[1], 2, 2 },
}
}
})
@@ -1885,9 +1895,9 @@ describe('API/win_extmark', function()
extmarks = {
[2] = {
-- positioned at the end of the 2nd line
- { {id = 1000}, 1, 1, 1, 16 },
+ { {id = 1000}, ns, marks[1], 1, 16 },
-- updated and wrapped to 3rd line
- { {id = 1000}, 1, 1, 2, 2 },
+ { {id = 1000}, ns, marks[1], 2, 2 },
-- scrolled up one line, should be handled by grid scroll
}
}
@@ -1923,13 +1933,13 @@ describe('API/win_extmark', function()
extmarks = {
[2] = {
-- positioned at the end of the 2nd line
- { {id = 1000}, 1, 1, 1, 16 },
+ { {id = 1000}, ns, marks[1], 1, 16 },
-- updated after split
- { {id = 1000}, 1, 1, 1, 16 },
+ { {id = 1000}, ns, marks[1], 1, 16 },
},
[4] = {
-- only after split
- { {id = 1001}, 1, 1, 1, 16 },
+ { {id = 1001}, ns, marks[1], 1, 16 },
}
}
})
@@ -1956,14 +1966,14 @@ describe('API/win_extmark', function()
extmarks = {
[2] = {
-- positioned at the end of the 2nd line
- { {id = 1000}, 1, 1, 1, 16 },
+ { {id = 1000}, ns, marks[1], 1, 16 },
-- updated after split
- { {id = 1000}, 1, 1, 1, 16 },
+ { {id = 1000}, ns, marks[1], 1, 16 },
},
[4] = {
- { {id = 1001}, 1, 1, 1, 16 },
+ { {id = 1001}, ns, marks[1], 1, 16 },
-- updated
- { {id = 1001}, 1, 1, 2, 2 },
+ { {id = 1001}, ns, marks[1], 2, 2 },
}
}
})