Patch 8.2.4233
Problem:    Crash when recording and using Select mode.
Solution:   When deleting the last recorded character check there is something
            to delete.
Files:      src/getchar.c, src/testdir/test_registers.vim


*** ../vim-8.2.4232/src/getchar.c       2022-01-19 22:51:44.225691562 +0000
--- src/getchar.c       2022-01-27 19:22:35.118697355 +0000
***************
*** 252,259 ****
      static void
  delete_buff_tail(buffheader_T *buf, int slen)
  {
!     int len = (int)STRLEN(buf->bh_curr->b_str);
  
      if (len >= slen)
      {
        buf->bh_curr->b_str[len - slen] = NUL;
--- 252,262 ----
      static void
  delete_buff_tail(buffheader_T *buf, int slen)
  {
!     int len;
  
+     if (buf->bh_curr == NULL || buf->bh_curr->b_str == NULL)
+       return;  // nothing to delete
+     len = (int)STRLEN(buf->bh_curr->b_str);
      if (len >= slen)
      {
        buf->bh_curr->b_str[len - slen] = NUL;
*** ../vim-8.2.4232/src/testdir/test_registers.vim      2022-01-03 
13:47:45.960911768 +0000
--- src/testdir/test_registers.vim      2022-01-27 19:25:26.704095927 +0000
***************
*** 739,744 ****
--- 739,753 ----
    bwipe!
  endfunc
  
+ func Test_record_in_select_mode()
+   new
+   call setline(1, 'text')
+   sil norm  q0 0
+   sil norm q
+   call assert_equal('0ext', getline(1))
+   bwipe!
+ endfunc
+ 
  " Make sure that y_append is correctly reset
  " and the previous register is working as expected
  func Test_register_y_append_reset()
*** ../vim-8.2.4232/src/version.c       2022-01-27 17:37:37.759862584 +0000
--- src/version.c       2022-01-27 19:25:52.735702803 +0000
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     4233,
  /**/

-- 
A fool must search for a greater fool to find admiration.

 /// 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/20220127192745.302E51C4EFE%40moolenaar.net.

Raspunde prin e-mail lui