Patch 9.0.0757
Problem:    Line number not visisble with 'smoothscroll', 'nu' and 'rnu'.
Solution:   Put the ">>>" after the line number instead of on top.
Files:      src/drawline.c, src/testdir/test_scroll_opt.vim,
            src/testdir/dumps/Test_smooth_number_7.dump


*** ../vim-9.0.0756/src/drawline.c      2022-10-13 22:12:07.164673822 +0100
--- src/drawline.c      2022-10-15 13:26:42.848762742 +0100
***************
*** 370,376 ****
  #ifdef FEAT_PROP_POPUP
                  + wlv->text_prop_above_count
  #endif
!                   && (wp->w_skipcol == 0 || wlv->row > wp->w_winrow))
          {
              long num;
              char *fmt = "%*ld ";
--- 370,377 ----
  #ifdef FEAT_PROP_POPUP
                  + wlv->text_prop_above_count
  #endif
!                   && (wp->w_skipcol == 0 || wlv->row > wp->w_winrow
!                                              || (wp->w_p_nu && wp->w_p_rnu)))
          {
              long num;
              char *fmt = "%*ld ";
***************
*** 770,777 ****
            )
      {
        int off = (int)(current_ScreenLine - ScreenLines);
  
!       for (int i = 0; i < 3; ++i)
        {
            ScreenLines[off] = '<';
            if (enc_utf8)
--- 771,788 ----
            )
      {
        int off = (int)(current_ScreenLine - ScreenLines);
+       int skip = 0;
  
!       if (wp->w_p_nu && wp->w_p_rnu)
!           // Do not overwrite the line number, change "123 text" to
!           // "123>>>xt".
!           while (skip < wp->w_width && VIM_ISDIGIT(ScreenLines[off]))
!           {
!               ++off;
!               ++skip;
!           }
! 
!       for (int i = 0; i < 3 && i + skip < wp->w_width; ++i)
        {
            ScreenLines[off] = '<';
            if (enc_utf8)
*** ../vim-9.0.0756/src/testdir/test_scroll_opt.vim     2022-10-12 
19:53:10.621726849 +0100
--- src/testdir/test_scroll_opt.vim     2022-10-15 13:36:12.845964511 +0100
***************
*** 121,126 ****
--- 121,137 ----
        set smoothscroll
        set number cpo+=n
        :3
+ 
+       def g:DoRel()
+         set number relativenumber scrolloff=0
+         :%del
+         setline(1, [
+           'one',
+           'very long text '->repeat(12),
+           'three',
+         ])
+         exe "normal 2Gzt\<C-E>"
+       enddef
    END
    call writefile(lines, 'XSmoothNumber', 'D')
    let buf = RunVimInTerminal('-S XSmoothNumber', #{rows: 12, cols: 40})
***************
*** 138,143 ****
--- 149,157 ----
    call term_sendkeys(buf, "\<C-Y>")
    call VerifyScreenDump(buf, 'Test_smooth_number_6', {})
  
+   call term_sendkeys(buf, ":call DoRel()\<CR>")
+   call VerifyScreenDump(buf, 'Test_smooth_number_7', {})
+ 
    call StopVimInTerminal(buf)
  endfunc
  
*** ../vim-9.0.0756/src/testdir/dumps/Test_smooth_number_7.dump 2022-10-15 
13:40:58.133020530 +0100
--- src/testdir/dumps/Test_smooth_number_7.dump 2022-10-15 13:36:16.009952952 
+0100
***************
*** 0 ****
--- 1,12 ----
+ |2+0#af5f00255#ffffff0|<+0#4040ff13&@2|o+0#0000000&|n|g| |t|e|x|t| |v|e|r|y| 
|l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n>g| |t|e
+ | +0#af5f00255&@3|x+0#0000000&|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| 
|l|o|n|g| |t|e|x|t| |v|e|r
+ | +0#af5f00255&@3|y+0#0000000&| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| 
|t|e|x|t| |v|e|r|y| |l|o|n|g
+ | +0#af5f00255&@3| +0#0000000&|t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| 
|v|e|r|y| |l|o|n|g| |t|e|x|t| 
+ | +0#af5f00255&@1|1| |t+0#0000000&|h|r|e@1| @30
+ |~+0#4040ff13&| @38
+ |~| @38
+ |~| @38
+ |~| @38
+ |~| @38
+ |~| @38
+ |-+0#0000000&@1|N|o|.@2|e|r|-@1| @10|2|,|7|3| @9|B|o|t| 
*** ../vim-9.0.0756/src/version.c       2022-10-15 11:47:54.217416750 +0100
--- src/version.c       2022-10-15 13:37:01.389790285 +0100
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     757,
  /**/

-- 
User:       I'm having problems with my text editor.
Help desk:  Which editor are you using?
User:       I don't know, but it's version VI (pronounced: 6).
Help desk:  Oh, then you should upgrade to version VIM (pronounced: 994).

 /// 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/20221015124248.489991C05ED%40moolenaar.net.

Raspunde prin e-mail lui