aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/quickfix.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-03-05 17:04:53 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-03-05 17:05:33 +0800
commite0bbe8ccf88d4ad0667ef38ae48d8bfdabb0cc26 (patch)
tree9dfb719f4f96fb49f36b87f9d169988b660059e0 /src/nvim/quickfix.c
parent749fe2c383f662bb13f97336329a0e08200c0a3b (diff)
downloadrneovim-e0bbe8ccf88d4ad0667ef38ae48d8bfdabb0cc26.tar.gz
rneovim-e0bbe8ccf88d4ad0667ef38ae48d8bfdabb0cc26.tar.bz2
rneovim-e0bbe8ccf88d4ad0667ef38ae48d8bfdabb0cc26.zip
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 (limited to 'src/nvim/quickfix.c')
-rw-r--r--src/nvim/quickfix.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 3c20c5239c..9f6181f986 100644
--- 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;
}