Patch 9.0.0148
Problem:    A "below" aligned text property gets 'showbreak' displayed.
Solution:   Do not use 'showbreak' before or in virtual text. (issue #10851)
Files:      src/drawline.c, src/testdir/test_textprop.vim


*** ../vim-9.0.0147/src/drawline.c      2022-08-05 20:03:51.516868750 +0100
--- src/drawline.c      2022-08-05 21:38:15.212551649 +0100
***************
*** 392,397 ****
--- 392,398 ----
  #ifdef FEAT_LINEBREAK
      int               need_showbreak = FALSE; // overlong line, skipping 
first x
                                        // chars
+     int               dont_use_showbreak = FALSE;  // do not use 'showbreak'
  #endif
  #if defined(FEAT_SIGNS) || defined(FEAT_QUICKFIX) \
        || defined(FEAT_SYN_HL) || defined(FEAT_DIFF)
***************
*** 1567,1573 ****
                            if (*ptr == NUL)
                                // don't combine char attr after EOL
                                text_prop_flags &= ~PT_FLAG_COMBINE;
! 
                            // Keep in sync with where
                            // textprop_size_after_trunc() is called in
                            // win_lbr_chartabsize().
--- 1568,1582 ----
                            if (*ptr == NUL)
                                // don't combine char attr after EOL
                                text_prop_flags &= ~PT_FLAG_COMBINE;
! #ifdef FEAT_LINEBREAK
!                           if (below || right)
!                           {
!                               // no 'showbreak' before "below" text property
!                               // or after "right" text property
!                               need_showbreak = FALSE;
!                               dont_use_showbreak = TRUE;
!                           }
! #endif
                            // Keep in sync with where
                            // textprop_size_after_trunc() is called in
                            // win_lbr_chartabsize().
***************
*** 3441,3449 ****
            n_extra = 0;
            lcs_prec_todo = wp->w_lcs_chars.prec;
  #ifdef FEAT_LINEBREAK
  # ifdef FEAT_DIFF
!           if (filler_todo <= 0)
  # endif
                need_showbreak = TRUE;
  #endif
  #ifdef FEAT_DIFF
--- 3450,3460 ----
            n_extra = 0;
            lcs_prec_todo = wp->w_lcs_chars.prec;
  #ifdef FEAT_LINEBREAK
+           if (!dont_use_showbreak
  # ifdef FEAT_DIFF
!                   && filler_todo <= 0
  # endif
+              )
                need_showbreak = TRUE;
  #endif
  #ifdef FEAT_DIFF
*** ../vim-9.0.0147/src/testdir/test_textprop.vim       2022-08-05 
20:25:46.670888624 +0100
--- src/testdir/test_textprop.vim       2022-08-05 21:34:53.268489089 +0100
***************
*** 2311,2316 ****
--- 2311,2317 ----
    CheckRunVimInTerminal
  
    let lines =<< trim END
+       set showbreak=+++
        call setline(1, 'some text here and other text there')
        call prop_type_add('rightprop', #{highlight: 'ErrorMsg'})
        call prop_type_add('afterprop', #{highlight: 'Search'})
*** ../vim-9.0.0147/src/version.c       2022-08-05 20:25:46.670888624 +0100
--- src/version.c       2022-08-05 21:25:41.719955504 +0100
***************
*** 737,738 ****
--- 737,740 ----
  {   /* Add new patch number below this line */
+ /**/
+     148,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
251. You've never seen your closest friends who usually live WAY too far away.

 /// 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/20220806092935.11A7E1C0EC3%40moolenaar.net.

Raspunde prin e-mail lui