fix(highlight): allow ephemeral extmarks past final newline #35888

Fixes #35814

Note: this is a temporary workaround; proper concurrency-safe handling
of highlighting should be investigated.
This commit is contained in:
skewb1k
2025-09-25 01:30:54 +03:00
committed by GitHub
parent eb7c12d3e3
commit 64966ba52c

View File

@@ -813,7 +813,8 @@ Integer nvim_buf_set_extmark(Buffer buffer, Integer ns_id, Integer line, Integer
len = opts->ephemeral ? MAXCOL : ml_get_buf_len(buf, (linenr_T)line2 + 1); len = opts->ephemeral ? MAXCOL : ml_get_buf_len(buf, (linenr_T)line2 + 1);
} else if (line2 == buf->b_ml.ml_line_count) { } else if (line2 == buf->b_ml.ml_line_count) {
// We are trying to add an extmark past final newline // We are trying to add an extmark past final newline
len = 0; // TODO(skewb1k): workaround for #35814. Investigate proper concurrency-safe handling of extmarks.
len = opts->ephemeral ? MAXCOL : 0;
} else { } else {
// reuse len from before // reuse len from before
line2 = (int)line; line2 = (int)line;