commit e0bbe8ccf88d4ad0667ef38ae48d8bfdabb0cc26
parent 749fe2c383f662bb13f97336329a0e08200c0a3b
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sun, 5 Mar 2023 17:04:53 +0800
vim-patch:9.0.0870: get E967 when using text property in quickfix window
Problem: Get E967 when using text property in quickfix window. (Sergey
Vlasov)
Solution: Do not add an extra NUL and compute the text length correctly.
(closes vim/vim#11513)
https://github.com/vim/vim/commit/2f7bfe66a1373051792f2ecaeefb66049825221d
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
@@ -3982,6 +3982,7 @@ static int qf_buf_add_line(qf_list_T *qfl, buf_T *buf, linenr_T lnum, const qfli
// for this entry, then use it.
if (qftf_str != NULL && *qftf_str != NUL) {
ga_concat(gap, qftf_str);
+ ga_append(gap, NUL);
} else {
buf_T *errbuf;
if (qfp->qf_module != NULL) {
@@ -4024,9 +4025,7 @@ static int qf_buf_add_line(qf_list_T *qfl, buf_T *buf, linenr_T lnum, const qfli
qf_fmt_text(gap, gap->ga_len > 3 ? skipwhite(qfp->qf_text) : qfp->qf_text);
}
- ga_append(gap, NUL);
-
- if (ml_append_buf(buf, lnum, gap->ga_data, gap->ga_len + 1, false) == FAIL) {
+ if (ml_append_buf(buf, lnum, gap->ga_data, gap->ga_len, false) == FAIL) {
return FAIL;
}