aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/statuscolumn_spec.lua
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2024-01-11 14:30:12 +0100
committerLewis Russell <me@lewisr.dev>2024-01-15 09:37:53 +0000
commit967c7abde3c6fa3210a4920a5848a54dc913d851 (patch)
treea44518ccfcfab9a0011f05f62aa0be543fd8a3e2 /test/functional/ui/statuscolumn_spec.lua
parent4d91604c8868b7afaf429cc16b72192ce89ea698 (diff)
downloadrneovim-967c7abde3c6fa3210a4920a5848a54dc913d851.tar.gz
rneovim-967c7abde3c6fa3210a4920a5848a54dc913d851.tar.bz2
rneovim-967c7abde3c6fa3210a4920a5848a54dc913d851.zip
fix(column): keep track of number of lines with number of signs
Problem: Some edge cases to the old (pre-#26406) and current "b_signcols" structure result in an incorrectly sized "auto" 'signcolumn'. Solution: * Implement a simpler 'signcolumn' validation strategy by immediately counting the number of signs in a range upon sign insertion and deletion. Decrease in performance here but there is a clear path forward to decreasing this performance hit by moving signs to a dedicated marktree, or by adding meta-data to the existing marktree which may be queried more efficiently? * Also replace "max_count" and keep track of the number of lines with a certain number of signs. This makes it so that it is no longer necessary to scan the entire buffer when the maximum number of signs decreases. This likely makes the commit a net increase in performance. * To ensure correctness we also have re-initialize the count for an edited region that spans multiple lines. Such an edit may move the signs within it. Thus we count and decrement before splicing the marktree and count and increment after.
Diffstat (limited to 'test/functional/ui/statuscolumn_spec.lua')
-rw-r--r--test/functional/ui/statuscolumn_spec.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/ui/statuscolumn_spec.lua b/test/functional/ui/statuscolumn_spec.lua
index dec696d3c3..d5aeb2c51a 100644
--- a/test/functional/ui/statuscolumn_spec.lua
+++ b/test/functional/ui/statuscolumn_spec.lua
@@ -521,8 +521,8 @@ describe('statuscolumn', function()
command([[set stc=%6s\ %l]])
exec_lua('vim.api.nvim_buf_set_extmark(0, ns, 7, 0, {sign_text = "ð’€€"})')
screen:expect([[
- {0: ð’€€ 8}^aaaaa |
- {0: }{1: }{0: 9}aaaaa |
+ {0: ð’€€ 8 }^aaaaa |
+ {0: }{1: }{0: 9 }aaaaa |
|
]])
end)