Patch 9.0.1327
Problem:    Cursor in wrong position below line with virtual text below ending
            in multi-byte character.
Solution:   When checking for last character take care of multi-byte
            character.
Files:      src/charset.c, src/testdir/test_textprop.vim,
            src/testdir/dumps/Test_prop_multibyte_below_1.dump


*** ../vim-9.0.1326/src/charset.c       2023-02-16 15:03:08.501667452 +0000
--- src/charset.c       2023-02-19 18:30:18.518639733 +0000
***************
*** 1196,1202 ****
                       || (tp->tp_col == MAXCOL
                           && ((tp->tp_flags & TP_FLAG_ALIGN_ABOVE)
                                ? col == 0
!                               : (s[0] == NUL || s[1] == NUL)
                                                  && cts->cts_with_trailing)))
                    && -tp->tp_id - 1 < gap->ga_len)
            {
--- 1196,1202 ----
                       || (tp->tp_col == MAXCOL
                           && ((tp->tp_flags & TP_FLAG_ALIGN_ABOVE)
                                ? col == 0
!                               : (s[0] == NUL || s[charlen] == NUL)
                                                  && cts->cts_with_trailing)))
                    && -tp->tp_id - 1 < gap->ga_len)
            {
*** ../vim-9.0.1326/src/testdir/test_textprop.vim       2023-02-19 
14:34:14.373629815 +0000
--- src/testdir/test_textprop.vim       2023-02-19 18:34:18.767071851 +0000
***************
*** 2817,2822 ****
--- 2817,2843 ----
    call StopVimInTerminal(buf)
  endfunc
  
+ func Test_prop_with_multibyte_below()
+   CheckRunVimInTerminal
+ 
+   let lines =<< trim END
+       setlocal number
+       call setline(1, ['©', '©', '©'])
+ 
+       let vt = 'test'
+       call prop_type_add(vt, {'highlight': 'ToDo'})
+       for ln in range(1, line('$'))
+         call prop_add(ln, 0, {'type': vt, 'text': '+++', 'text_align': 
'below'})
+       endfor
+       normal G
+   END
+   call writefile(lines, 'XscriptPropMultibyteBelow', 'D')
+   let buf = RunVimInTerminal('-S XscriptPropMultibyteBelow', #{rows: 10, 
cols: 60})
+   call VerifyScreenDump(buf, 'Test_prop_multibyte_below_1', {})
+ 
+   call StopVimInTerminal(buf)
+ endfunc
+ 
  func Test_prop_with_text_above_empty()
    CheckRunVimInTerminal
  
*** ../vim-9.0.1326/src/testdir/dumps/Test_prop_multibyte_below_1.dump  
2023-02-19 18:36:16.019267471 +0000
--- src/testdir/dumps/Test_prop_multibyte_below_1.dump  2023-02-19 
18:34:42.523112166 +0000
***************
*** 0 ****
--- 1,10 ----
+ | +0#af5f00255#ffffff0@1|1| |©+0#0000000&| @54
+ | +0#af5f00255&@3|++0#0000001#ffff4012@2| +0#0000000#ffffff0@52
+ | +0#af5f00255&@1|2| |©+0#0000000&| @54
+ | +0#af5f00255&@3|++0#0000001#ffff4012@2| +0#0000000#ffffff0@52
+ | +0#af5f00255&@1|3| >©+0#0000000&| @54
+ | +0#af5f00255&@3|++0#0000001#ffff4012@2| +0#0000000#ffffff0@52
+ |~+0#4040ff13&| @58
+ |~| @58
+ |~| @58
+ | +0#0000000&@41|3|,|1| @10|A|l@1| 
*** ../vim-9.0.1326/src/version.c       2023-02-19 14:34:14.377629815 +0000
--- src/version.c       2023-02-19 18:31:33.178779323 +0000
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     1327,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
151. You find yourself engaged to someone you've never actually met,
     except through e-mail.

 /// 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/20230219183708.08E291C07A0%40moolenaar.net.

Raspunde prin e-mail lui