neovim/test/functional/api
bfredl b04286a187 feat(extmark): support proper multiline ranges
The removes the previous restriction that nvim_buf_set_extmark()
could not be used to highlight arbitrary multi-line regions

The problem can be summarized as follows: let's assume an extmark with a
hl_group is placed covering the region (5,0) to (50,0) Now, consider
what happens if nvim needs to redraw a window covering the lines 20-30.
It needs to be able to ask the marktree what extmarks cover this region,
even if they don't begin or end here.

Therefore the marktree needs to be augmented with the information covers
a point, not just what marks begin or end there. To do this, we augment
each node with a field "intersect" which is a set the ids of the
marks which overlap this node, but only if it is not part of the set of
any parent. This ensures the number of nodes that need to be explicitly
marked grows only logarithmically with the total number of explicitly
nodes (and thus the number of of overlapping marks).

Thus we can quickly iterate all marks which overlaps any query position
by looking up what leaf node contains that position. Then we only need
to consider all "start" marks within that leaf node, and the "intersect"
set of that node and all its parents.

Now, and the major source of complexity is that the tree restructuring
operations (to ensure that each node has T-1 <= size <= 2*T-1) also need
to update these sets. If a full inner node is split in two, one of the
new parents might start to completely overlap some ranges and its ids
will need to be moved from its children's sets to its own set.
Similarly, if two undersized nodes gets joined into one, it might no
longer completely overlap some ranges, and now the children which do
needs to have the have the ids in its set instead. And then there are
the pivots! Yes the pivot operations when a child gets moved from one
parent to another.
2023-09-12 10:38:23 +02:00
..
autocmd_spec.lua test(api): update tests to new error messages 2023-08-07 13:18:11 +02:00
buffer_spec.lua fix(api): more intuitive cursor updates in nvim_buf_set_text 2023-09-11 08:16:03 +04:00
buffer_updates_spec.lua refactor(defaults)!: change default 'commentstring' value to empty (#22862) 2023-04-02 23:01:48 +08:00
command_spec.lua fix(api): allow empty Lua table for nested dicts #22268 2023-02-16 07:07:18 -08:00
extmark_spec.lua feat(extmark): support proper multiline ranges 2023-09-12 10:38:23 +02:00
highlight_spec.lua fix(highlight): add create param in nvim_get_hl 2023-09-09 17:15:58 +08:00
keymap_spec.lua test: more tests for nvim_{set,del}_keymap with abbreviation (#23970) 2023-06-10 10:44:31 +08:00
menu_spec.lua tests/ui: remove unnecessary screen:detach() 2019-10-13 22:10:42 +02:00
proc_spec.lua refactor(api): consistent VALIDATE messages #22262 2023-02-14 11:19:28 -08:00
rpc_fixture.lua fix(tests): fixes for using vim.mpack and more ASAN 2023-02-10 20:19:04 +01:00
server_notifications_spec.lua test: unignore test which froze sourcehut (#25067) 2023-09-11 05:53:05 +08:00
server_requests_spec.lua fix(tests): fixes for using vim.mpack and more ASAN 2023-02-10 20:19:04 +01:00
tabpage_spec.lua API: include invalid buffer/window/tabpage in error message (#11712) 2020-01-14 09:21:10 +01:00
ui_spec.lua test: fix VimResume test flakiness (#24438) 2023-07-23 10:03:05 +08:00
version_spec.lua feat: report "build" in vim.version() #23925 2023-06-11 14:57:23 -07:00
vim_spec.lua fix(options): correct condition for calling did_set_option() (#25026) 2023-09-05 20:03:25 +08:00
window_spec.lua fix(api): disallow win_set_buf from changing cmdwin's old curbuf (#24745) 2023-08-17 00:53:10 +01:00