Patch 8.2.4707
Problem:    Redrawing could be a bit more efficient.
Solution:   Optimize redrawing. (closes #10105)
Files:      src/change.c, src/edit.c, src/testdir/test_highlight.vim,
            src/testdir/dumps/Test_cursorcolumn_insert_on_tab_3.dump


*** ../vim-8.2.4706/src/change.c        2022-03-29 11:38:13.639070607 +0100
--- src/change.c        2022-04-07 15:01:40.301185584 +0100
***************
*** 640,648 ****
            if (hasAnyFolding(wp))
                set_topline(wp, wp->w_topline);
  #endif
!           // Relative numbering may require updating more.
            if (wp->w_p_rnu && xtra != 0)
!               redraw_win_later(wp, SOME_VALID);
  #ifdef FEAT_SYN_HL
            // Cursor line highlighting probably need to be updated with
            // "VALID" if it's below the change.
--- 640,652 ----
            if (hasAnyFolding(wp))
                set_topline(wp, wp->w_topline);
  #endif
!           // If lines have been added or removed, relative numbering always
!           // requires a redraw.
            if (wp->w_p_rnu && xtra != 0)
!           {
!               wp->w_last_cursor_lnum_rnu = 0;
!               redraw_win_later(wp, VALID);
!           }
  #ifdef FEAT_SYN_HL
            // Cursor line highlighting probably need to be updated with
            // "VALID" if it's below the change.
*** ../vim-8.2.4706/src/edit.c  2022-04-01 12:04:53.171621974 +0100
--- src/edit.c  2022-04-07 15:01:40.305185575 +0100
***************
*** 293,306 ****
      conceal_check_cursor_line(cursor_line_was_concealed);
  #endif
  
!     // Need to recompute the cursor position, it might move when the cursor
!     // is on a TAB or special character.
!     // ptr2cells() treats a TAB character as double-width.
!     if (ptr2cells(ml_get_cursor()) > 1)
!     {
!       curwin->w_valid &= ~VALID_VIRTCOL;
!       curs_columns(TRUE);
!     }
  
      /*
       * Enable langmap or IME, indicated by 'iminsert'.
--- 293,301 ----
      conceal_check_cursor_line(cursor_line_was_concealed);
  #endif
  
!     // need to position cursor again when on a TAB
!     if (gchar_cursor() == TAB)
!       curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL);
  
      /*
       * Enable langmap or IME, indicated by 'iminsert'.
***************
*** 3149,3169 ****
                replace_push(c);
                break;
            }
            else
            {
!               buf[0] = c;
!               for (i = 1; i < n; ++i)
!                   buf[i] = replace_pop();
!               if (utf_iscomposing(utf_ptr2char(buf)))
!                   ins_bytes_len(buf, n);
!               else
!               {
!                   // Not a composing char, put it back.
!                   for (i = n - 1; i >= 0; --i)
!                       replace_push(buf[i]);
!                   break;
!               }
            }
        }
  }
  
--- 3144,3163 ----
                replace_push(c);
                break;
            }
+ 
+           buf[0] = c;
+           for (i = 1; i < n; ++i)
+               buf[i] = replace_pop();
+           if (utf_iscomposing(utf_ptr2char(buf)))
+               ins_bytes_len(buf, n);
            else
            {
!               // Not a composing char, put it back.
!               for (i = n - 1; i >= 0; --i)
!                   replace_push(buf[i]);
!               break;
            }
+ 
        }
  }
  
***************
*** 3702,3709 ****
  
      State = NORMAL;
      trigger_modechanged();
!     // need to position cursor again (e.g. when on a TAB )
!     changed_cline_bef_curs();
  
      setmouse();
  #ifdef CURSOR_SHAPE
--- 3696,3704 ----
  
      State = NORMAL;
      trigger_modechanged();
!     // need to position cursor again when on a TAB
!     if (gchar_cursor() == TAB)
!       curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL);
  
      setmouse();
  #ifdef CURSOR_SHAPE
*** ../vim-8.2.4706/src/testdir/test_highlight.vim      2022-04-03 
18:01:39.659574455 +0100
--- src/testdir/test_highlight.vim      2022-04-07 15:01:40.305185575 +0100
***************
*** 610,615 ****
--- 610,623 ----
    call TermWait(buf)
    call VerifyScreenDump(buf, 'Test_cursorcolumn_insert_on_tab_2', {})
  
+   call term_sendkeys(buf, "\<C-O>")
+   call TermWait(buf)
+   call VerifyScreenDump(buf, 'Test_cursorcolumn_insert_on_tab_3', {})
+ 
+   call term_sendkeys(buf, 'i')
+   call TermWait(buf)
+   call VerifyScreenDump(buf, 'Test_cursorcolumn_insert_on_tab_2', {})
+ 
    call StopVimInTerminal(buf)
    call delete('Xcuc_insert_on_tab')
  endfunc
*** ../vim-8.2.4706/src/testdir/dumps/Test_cursorcolumn_insert_on_tab_3.dump    
2022-04-07 15:07:22.188560756 +0100
--- src/testdir/dumps/Test_cursorcolumn_insert_on_tab_3.dump    2022-04-07 
15:01:40.305185575 +0100
***************
*** 0 ****
--- 1,8 ----
+ |1+0&#ffffff0|2|3|4|5|6|7|8+0&#e0e0e08|9+0&#ffffff0| @65
+ |a| @5> |b| @65
+ |~+0#4040ff13&| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |-+2#0000000&@1| |(|i|n|s|e|r|t|)| |-@1| +0&&@42|2|,|2|-|8| @8|A|l@1| 
*** ../vim-8.2.4706/src/version.c       2022-04-07 14:08:26.405867546 +0100
--- src/version.c       2022-04-07 15:06:58.236603424 +0100
***************
*** 748,749 ****
--- 748,751 ----
  {   /* Add new patch number below this line */
+ /**/
+     4707,
  /**/

-- 
JOHN CLEESE PLAYED: SECOND SOLDIER WITH A KEEN INTEREST IN BIRDS, LARGE MAN
                    WITH DEAD BODY, BLACK KNIGHT, MR NEWT (A VILLAGE
                    BLACKSMITH INTERESTED IN BURNING WITCHES), A QUITE
                    EXTRAORDINARILY RUDE FRENCHMAN, TIM THE WIZARD, SIR
                    LAUNCELOT
                 "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/20220407140845.2E5D01C19BB%40moolenaar.net.

Raspunde prin e-mail lui