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 -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20221113125522.217941C0473%40moolenaar.net.

Raspunde prin e-mail lui