Patch 9.0.0183
Problem:    Extra space after virtual text when 'linebreak' is set.
Solution:   Do not count virtual text when getting linebreak value.
            (closes #10884)
Files:      src/drawline.c, src/testdir/test_textprop.vim,
            src/testdir/dumps/Test_prop_with_linebreak_1.dump,
            src/testdir/dumps/Test_prop_with_linebreak_2.dump


*** ../vim-9.0.0182/src/drawline.c      2022-08-09 12:24:51.196531689 +0100
--- src/drawline.c      2022-08-10 13:10:33.237329564 +0100
***************
*** 2370,2376 ****
--- 2370,2381 ----
                    chartabsize_T cts;
  
                    init_chartabsize_arg(&cts, wp, lnum, wlv.vcol, line, p);
+ # ifdef FEAT_PROP_POPUP
+                   // do not want virtual text counted here
+                   cts.cts_has_prop_with_text = FALSE;
+ # endif
                    wlv.n_extra = win_lbr_chartabsize(&cts, NULL) - 1;
+                   clear_chartabsize_arg(&cts);
  
                    // We have just drawn the showbreak value, no need to add
                    // space for it again.
***************
*** 2398,2404 ****
  
                    wlv.c_extra = mb_off > 0 ? MB_FILLER_CHAR : ' ';
                    wlv.c_final = NUL;
! # if defined(FEAT_PROP_POPUP)
                    if (wlv.n_extra > 0 && c != TAB)
                        in_linebreak = TRUE;
  # endif
--- 2403,2409 ----
  
                    wlv.c_extra = mb_off > 0 ? MB_FILLER_CHAR : ' ';
                    wlv.c_final = NUL;
! # ifdef FEAT_PROP_POPUP
                    if (wlv.n_extra > 0 && c != TAB)
                        in_linebreak = TRUE;
  # endif
***************
*** 2412,2421 ****
                        if (!wp->w_p_list)
                            c = ' ';
                    }
-                   clear_chartabsize_arg(&cts);
                }
  #endif
- 
                in_multispace = c == ' '
                    && ((ptr > line + 1 && ptr[-2] == ' ') || *ptr == ' ');
                if (!in_multispace)
--- 2417,2424 ----
*** ../vim-9.0.0182/src/testdir/test_textprop.vim       2022-08-09 
21:37:51.355177041 +0100
--- src/testdir/test_textprop.vim       2022-08-10 13:08:41.563731160 +0100
***************
*** 1878,1883 ****
--- 1878,1903 ----
    call delete('XscriptPropLinebreak')
  endfunc
  
+ func Test_prop_with_linebreak()
+   CheckRunVimInTerminal
+ 
+   let lines =<< trim END
+       vim9script
+       set linebreak
+       setline(1, 'one twoword')
+       prop_type_add('test', {highlight: 'Special'})
+       prop_add(1, 4, {text: ': virtual text', type: 'test', text_wrap: 
'wrap'})
+   END
+   call writefile(lines, 'XscriptPropWithLinebreak')
+   let buf = RunVimInTerminal('-S XscriptPropWithLinebreak', #{rows: 6, cols: 
50})
+   call VerifyScreenDump(buf, 'Test_prop_with_linebreak_1', {})
+   call term_sendkeys(buf, "iasdf asdf asdf asdf asdf as\<Esc>")
+   call VerifyScreenDump(buf, 'Test_prop_with_linebreak_2', {})
+ 
+   call StopVimInTerminal(buf)
+   call delete('XscriptPropWithLinebreak')
+ endfunc
+ 
  func Test_prop_after_tab()
    CheckRunVimInTerminal
  
*** ../vim-9.0.0182/src/testdir/dumps/Test_prop_with_linebreak_1.dump   
2022-08-10 13:11:24.878134168 +0100
--- src/testdir/dumps/Test_prop_with_linebreak_1.dump   2022-08-10 
13:08:45.267780736 +0100
***************
*** 0 ****
--- 1,6 ----
+ >o+0&#ffffff0|n|e|:+0#e000e06&| |v|i|r|t|u|a|l| |t|e|x|t| 
+0#0000000&|t|w|o|w|o|r|d| @24
+ |~+0#4040ff13&| @48
+ |~| @48
+ |~| @48
+ |~| @48
+ | +0#0000000&@31|1|,|1| @10|A|l@1| 
*** ../vim-9.0.0182/src/testdir/dumps/Test_prop_with_linebreak_2.dump   
2022-08-10 13:11:24.882134232 +0100
--- src/testdir/dumps/Test_prop_with_linebreak_2.dump   2022-08-10 
13:08:46.415796152 +0100
***************
*** 0 ****
--- 1,6 ----
+ |a+0&#ffffff0|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| 
|a>s|o|n|e|:+0#e000e06&| |v|i|r|t|u|a|l| |t|e|x|t| +0#0000000&@5
+ |t|w|o|w|o|r|d| @42
+ |~+0#4040ff13&| @48
+ |~| @48
+ |~| @48
+ | +0#0000000&@31|1|,|2|7| @9|A|l@1| 
*** ../vim-9.0.0182/src/version.c       2022-08-10 11:48:07.089830558 +0100
--- src/version.c       2022-08-10 13:04:43.565170600 +0100
***************
*** 737,738 ****
--- 737,740 ----
  {   /* Add new patch number below this line */
+ /**/
+     183,
  /**/

-- 
FIRST HEAD:  Oh! quick! get the sword out I want to cut his head off.
THIRD HEAD:  Oh, cut your own head off.
SECOND HEAD: Yes - do us all a favour.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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/20220810121234.607791C4F15%40moolenaar.net.

Raspunde prin e-mail lui