Patch 8.2.2493
Problem:    Text property for text left of window shows up.
Solution:   Check if the text property ends before the current column.
            (closes #7806)
Files:      src/drawline.c, src/testdir/test_textprop.vim,
            src/testdir/dumps/Test_textprop_nowrap_01.dump,
            src/testdir/dumps/Test_textprop_nowrap_02.dump


*** ../vim-8.2.2492/src/drawline.c      2021-02-03 15:58:09.084690899 +0100
--- src/drawline.c      2021-02-10 17:15:45.571223391 +0100
***************
*** 1418,1424 ****
                // Add any text property that starts in this column.
                while (text_prop_next < text_prop_count
                           && bcol >= text_props[text_prop_next].tp_col - 1)
!                   text_prop_idxs[text_props_active++] = text_prop_next++;
  
                text_prop_attr = 0;
                text_prop_combine = FALSE;
--- 1418,1429 ----
                // Add any text property that starts in this column.
                while (text_prop_next < text_prop_count
                           && bcol >= text_props[text_prop_next].tp_col - 1)
!               {
!                   if (bcol <= text_props[text_prop_next].tp_col - 1
!                                          + text_props[text_prop_next].tp_len)
!                       text_prop_idxs[text_props_active++] = text_prop_next;
!                   ++text_prop_next;
!               }
  
                text_prop_attr = 0;
                text_prop_combine = FALSE;
*** ../vim-8.2.2492/src/testdir/test_textprop.vim       2021-01-30 
17:16:24.644042685 +0100
--- src/testdir/test_textprop.vim       2021-02-10 17:11:54.163774615 +0100
***************
*** 1049,1054 ****
--- 1049,1078 ----
    call delete('XtestPropTab')
  endfunc
  
+ func Test_textprop_nowrap_scrolled()
+   CheckScreendump
+ 
+   let lines =<< trim END
+        vim9script
+        set nowrap
+        setline(1, 'The number 123 is smaller than 4567.' .. repeat('X', 
&columns))
+        prop_type_add('number', {'highlight': 'ErrorMsg'})
+        prop_add(1, 12, {'length': 3, 'type': 'number'})
+        prop_add(1, 32, {'length': 4, 'type': 'number'})
+        feedkeys('gg20zl', 'nxt')
+   END
+   call writefile(lines, 'XtestNowrap')
+   let buf = RunVimInTerminal('-S XtestNowrap', {'rows': 6})
+   call VerifyScreenDump(buf, 'Test_textprop_nowrap_01', {})
+ 
+   call term_sendkeys(buf, "$")
+   call VerifyScreenDump(buf, 'Test_textprop_nowrap_02', {})
+ 
+   " clean up
+   call StopVimInTerminal(buf)
+   call delete('XtestNowrap')
+ endfunc
+ 
  func Test_textprop_with_syntax()
    CheckScreendump
  
*** ../vim-8.2.2492/src/testdir/dumps/Test_textprop_nowrap_01.dump      
2021-02-10 17:19:37.978677893 +0100
--- src/testdir/dumps/Test_textprop_nowrap_01.dump      2021-02-10 
17:12:15.639723015 +0100
***************
*** 0 ****
--- 1,6 ----
+ >a+0&#ffffff0|l@1|e|r| |t|h|a|n| 
|4+0#ffffff16#e000002|5|6|7|.+0#0000000#ffffff0|X@58
+ |~+0#4040ff13&| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ | +0#0000000&@56|1|,|2|1| @9|A|l@1| 
*** ../vim-8.2.2492/src/testdir/dumps/Test_textprop_nowrap_02.dump      
2021-02-10 17:19:37.978677893 +0100
--- src/testdir/dumps/Test_textprop_nowrap_02.dump      2021-02-10 
17:12:16.687720501 +0100
***************
*** 0 ****
--- 1,6 ----
+ |X+0&#ffffff0@36>X| @36
+ |~+0#4040ff13&| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ | +0#0000000&@56|1|,|1@2| @8|A|l@1| 
*** ../vim-8.2.2492/src/version.c       2021-02-10 16:45:21.395462258 +0100
--- src/version.c       2021-02-10 17:02:26.673101411 +0100
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2493,
  /**/

-- 
`When any government, or any church for that matter, undertakes to say to
 its subjects, "This you may not read, this you must not see, this you are
 forbidden to know," the end result is tyranny and oppression no matter how
 holy the motives' -- Robert A Heinlein, "If this goes on --"

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/202102101621.11AGLE4D364236%40masaka.moolenaar.net.

Raspunde prin e-mail lui