mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
bufhl: simplify redraw logic
using changed_lines_buf was technically incorrect, as the buffer wasn't modififed.
This commit is contained in:
parent
b819795661
commit
d5d8deec06
@ -5347,8 +5347,7 @@ int bufhl_add_hl(buf_T *buf,
|
||||
hlentry->stop = col_end;
|
||||
|
||||
if (0 < lnum && lnum <= buf->b_ml.ml_line_count) {
|
||||
changed_lines_buf(buf, lnum, lnum+1, 0);
|
||||
redraw_buf_later(buf, VALID);
|
||||
redraw_buf_line_later(buf, lnum);
|
||||
}
|
||||
return src_id;
|
||||
}
|
||||
@ -5414,8 +5413,7 @@ int bufhl_add_virt_text(buf_T *buf,
|
||||
}
|
||||
|
||||
if (0 < lnum && lnum <= buf->b_ml.ml_line_count) {
|
||||
changed_lines_buf(buf, lnum, lnum+1, 0);
|
||||
redraw_buf_later(buf, VALID);
|
||||
redraw_buf_line_later(buf, lnum);
|
||||
}
|
||||
return src_id;
|
||||
}
|
||||
@ -5440,8 +5438,6 @@ void bufhl_clear_line_range(buf_T *buf,
|
||||
linenr_T line_start,
|
||||
linenr_T line_end)
|
||||
{
|
||||
linenr_T first_changed = MAXLNUM, last_changed = -1;
|
||||
|
||||
kbitr_t(bufhl) itr;
|
||||
BufhlLine *l, t = BUFHLLINE_INIT(line_start);
|
||||
if (!kb_itr_get(bufhl, &buf->b_bufhl_info, &t, &itr)) {
|
||||
@ -5456,12 +5452,7 @@ void bufhl_clear_line_range(buf_T *buf,
|
||||
if (line_start <= line) {
|
||||
BufhlLineStatus status = bufhl_clear_line(l, src_id, line);
|
||||
if (status != kBLSUnchanged) {
|
||||
if (line > last_changed) {
|
||||
last_changed = line;
|
||||
}
|
||||
if (line < first_changed) {
|
||||
first_changed = line;
|
||||
}
|
||||
redraw_buf_line_later(buf, line);
|
||||
}
|
||||
if (status == kBLSDeleted) {
|
||||
kb_del_itr(bufhl, &buf->b_bufhl_info, &itr);
|
||||
@ -5469,11 +5460,6 @@ void bufhl_clear_line_range(buf_T *buf,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (last_changed != -1) {
|
||||
changed_lines_buf(buf, first_changed, last_changed+1, 0);
|
||||
redraw_buf_later(buf, VALID);
|
||||
}
|
||||
}
|
||||
|
||||
/// Clear bufhl highlights from a given source group and given line
|
||||
|
Loading…
Reference in New Issue
Block a user