fix(column): don't count signs on lines beyond eob #33410

Problem:  Computed previous buffer line count may be beyond end of
          buffer. This results in signs being removed from `b_signcols`
          that were never included in it, tripping an assertion.

Solution: Store the previous line count as it was before appending or
          deleting lines. Use it to clamp the edited region when
          clearing signs before a splice, after which it is reset.
This commit is contained in:
luukvbaal
2025-04-11 13:46:55 +02:00
committed by GitHub
parent 064ff74cdb
commit 4a706a7092
4 changed files with 21 additions and 2 deletions

View File

@@ -720,6 +720,11 @@ struct file_buffer {
MarkTree b_marktree[1];
Map(uint32_t, uint32_t) b_extmark_ns[1]; // extmark namespaces
// Store the line count as it was before appending or inserting lines.
// Used to determine a valid range before splicing marks, when the line
// count has already changed.
int b_prev_line_count;
// array of channel_id:s which have asked to receive updates for this
// buffer.
kvec_t(uint64_t) update_channels;