Patch 9.0.0653 (after 8.2.0260)
Problem:    BS and DEL do not work properly in an interacive shell. (Gary
            Johnson)
Solution:   Adjust the length for replaced codes.
Files:      src/term.c, src/proto/term.pro, src/os_unix.c, src/os_win32.c


*** ../vim-9.0.0652/src/term.c  2022-10-01 21:22:14.034403197 +0100
--- src/term.c  2022-10-03 20:18:02.199127009 +0100
***************
*** 6733,6743 ****
  #endif
  
  /*
!  * Replace K_BS by <BS> and K_DEL by <DEL>
   */
!     void
! term_replace_bs_del_keycode(char_u *ta_buf, int ta_len, int len)
  {
      int               i;
      int               c;
  
--- 6733,6745 ----
  #endif
  
  /*
!  * Replace K_BS by <BS> and K_DEL by <DEL>.
!  * Returns "len" adjusted for replaced codes.
   */
!     int
! term_replace_bs_del_keycode(char_u *ta_buf, int ta_len, int len_arg)
  {
+     int               len = len_arg;
      int               i;
      int               c;
  
***************
*** 6762,6765 ****
--- 6764,6768 ----
        if (has_mbyte)
            i += (*mb_ptr2len_len)(ta_buf + i, ta_len + len - i) - 1;
      }
+     return len;
  }
*** ../vim-9.0.0652/src/proto/term.pro  2022-06-27 23:15:25.000000000 +0100
--- src/proto/term.pro  2022-10-03 20:20:15.683105963 +0100
***************
*** 86,90 ****
  void swap_tcap(void);
  void ansi_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u 
*ansi_idx);
  void cterm_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u 
*ansi_idx);
! void term_replace_bs_del_keycode(char_u *ta_buf, int ta_len, int len);
  /* vim: set ft=c : */
--- 86,90 ----
  void swap_tcap(void);
  void ansi_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u 
*ansi_idx);
  void cterm_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u 
*ansi_idx);
! int term_replace_bs_del_keycode(char_u *ta_buf, int ta_len, int len_arg);
  /* vim: set ft=c : */
*** ../vim-9.0.0652/src/os_unix.c       2022-09-27 15:48:17.518491735 +0100
--- src/os_unix.c       2022-10-03 20:19:42.459114604 +0100
***************
*** 5106,5112 ****
                            }
                        }
  
!                       term_replace_bs_del_keycode(ta_buf, ta_len, len);
  
                        /*
                         * For pipes: echo the typed characters.
--- 5106,5112 ----
                            }
                        }
  
!                       len = term_replace_bs_del_keycode(ta_buf, ta_len, len);
  
                        /*
                         * For pipes: echo the typed characters.
*** ../vim-9.0.0652/src/os_win32.c      2022-09-18 12:24:30.546430897 +0100
--- src/os_win32.c      2022-10-03 20:20:08.327108057 +0100
***************
*** 4531,4537 ****
                        }
                    }
  
!                   term_replace_bs_del_keycode(ta_buf, ta_len, len);
  
                    /*
                     * For pipes: echo the typed characters.  For a pty this
--- 4531,4537 ----
                        }
                    }
  
!                   len = term_replace_bs_del_keycode(ta_buf, ta_len, len);
  
                    /*
                     * For pipes: echo the typed characters.  For a pty this
*** ../vim-9.0.0652/src/version.c       2022-10-03 20:00:49.400319129 +0100
--- src/version.c       2022-10-03 20:20:33.695100424 +0100
***************
*** 701,702 ****
--- 701,704 ----
  {   /* Add new patch number below this line */
+ /**/
+     653,
  /**/

-- 
Error 42: No errors

 /// 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/20221003192654.1D9471C09A3%40moolenaar.net.

Raspunde prin e-mail lui