To: vim_dev@googlegroups.com Subject: Patch 9.0.0870 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0870 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 #11513) Files: src/quickfix.c, src/testdir/test_textprop.vim *** ../vim-9.0.0869/src/quickfix.c 2022-10-20 16:03:29.486536722 +0100 --- src/quickfix.c 2022-11-13 12:53:20.870871474 +0000 *************** *** 4645,4651 **** --- 4645,4654 ---- // If the 'quickfixtextfunc' function returned a non-empty custom string // for this entry, then use it. if (qftf_str != NULL && *qftf_str != NUL) + { ga_concat(gap, qftf_str); + ga_append(gap, NUL); + } else { if (qfp->qf_module != NULL) *************** *** 4687,4698 **** // Remove newlines and leading whitespace from the text. // For an unrecognized line keep the indent, the compiler may // mark a word with ^^^^. ! 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) return FAIL; return OK; --- 4690,4700 ---- // Remove newlines and leading whitespace from the text. // For an unrecognized line keep the indent, the compiler may // mark a word with ^^^^. ! qf_fmt_text(gap, gap->ga_len > 3 ? skipwhite(qfp->qf_text) ! : qfp->qf_text); } ! if (ml_append_buf(buf, lnum, gap->ga_data, gap->ga_len, FALSE) == FAIL) return FAIL; return OK; *** ../vim-9.0.0869/src/testdir/test_textprop.vim 2022-11-02 13:30:37.546314580 +0000 --- src/testdir/test_textprop.vim 2022-11-13 12:52:44.646860366 +0000 *************** *** 3434,3437 **** --- 3434,3464 ---- call StopVimInTerminal(buf) endfunc + def Test_textprop_in_quickfix_window() + enew! + var prop_type = 'my_prop' + prop_type_add(prop_type, {}) + + for lnum in range(1, 10) + setline(lnum, 'hello world') + endfor + + cgetbuffer + copen + + var bufnr = bufnr() + for lnum in range(1, line('$', bufnr->bufwinid())) + prop_add(lnum, 1, { + id: 1000 + lnum, + type: prop_type, + bufnr: bufnr, + }) + endfor + + prop_type_delete(prop_type) + cclose + bwipe! + enddef + + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-9.0.0869/src/version.c 2022-11-12 23:12:51.076972077 +0000 --- src/version.c 2022-11-13 12:49:44.006808026 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 870, /**/ -- "I can't complain, but sometimes I still do." (Joe Walsh) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///