From 64966ba52cea49333da076aff26866730314e259 Mon Sep 17 00:00:00 2001 From: skewb1k Date: Thu, 25 Sep 2025 01:30:54 +0300 Subject: [PATCH] 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. --- src/nvim/api/extmark.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nvim/api/extmark.c b/src/nvim/api/extmark.c index a14cf426f4..53aa0b1053 100644 --- a/src/nvim/api/extmark.c +++ b/src/nvim/api/extmark.c @@ -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); } else if (line2 == buf->b_ml.ml_line_count) { // 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 { // reuse len from before line2 = (int)line;