Patch 9.0.0218
Problem:    Reading before the start of the line.
Solution:   When displaying "$" check the column is not negative.
Files:      src/edit.c, src/proto/edit.pro, src/testdir/test_cmdwin.vim


*** ../vim-9.0.0217/src/edit.c  2022-08-14 14:16:07.987582278 +0100
--- src/edit.c  2022-08-16 14:47:05.883332550 +0100
***************
*** 1746,1753 ****
   * Only works when cursor is in the line that changes.
   */
      void
! display_dollar(colnr_T col)
  {
      colnr_T save_col;
  
      if (!redrawing())
--- 1746,1754 ----
   * Only works when cursor is in the line that changes.
   */
      void
! display_dollar(colnr_T col_arg)
  {
+     colnr_T col = col_arg < 0 ? 0 : col_arg;
      colnr_T save_col;
  
      if (!redrawing())
*** ../vim-9.0.0217/src/proto/edit.pro  2022-06-27 23:15:02.000000000 +0100
--- src/proto/edit.pro  2022-08-16 14:48:51.739015452 +0100
***************
*** 5,11 ****
  void edit_putchar(int c, int highlight);
  void set_insstart(linenr_T lnum, int col);
  void edit_unputchar(void);
! void display_dollar(colnr_T col);
  void undisplay_dollar(void);
  void truncate_spaces(char_u *line);
  void backspace_until_column(int col);
--- 5,11 ----
  void edit_putchar(int c, int highlight);
  void set_insstart(linenr_T lnum, int col);
  void edit_unputchar(void);
! void display_dollar(colnr_T col_arg);
  void undisplay_dollar(void);
  void truncate_spaces(char_u *line);
  void backspace_until_column(int col);
*** ../vim-9.0.0217/src/testdir/test_cmdwin.vim 2022-07-24 20:07:57.656416981 
+0100
--- src/testdir/test_cmdwin.vim 2022-08-16 14:44:23.931855079 +0100
***************
*** 365,369 ****
--- 365,377 ----
    call assert_match('E1292:', caught)
  endfunc
  
+ func Test_cmdwin_virtual_edit()
+   enew!
+   set ve=all cpo+=$
+   silent normal q/s
+ 
+   set ve= cpo-=$
+ endfunc
+ 
  
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-9.0.0217/src/version.c       2022-08-15 17:53:51.912974674 +0100
--- src/version.c       2022-08-16 14:47:55.587181576 +0100
***************
*** 737,738 ****
--- 737,740 ----
  {   /* Add new patch number below this line */
+ /**/
+     218,
  /**/

-- 
WOMAN:   Dennis, there's some lovely filth down here.  Oh -- how d'you do?
ARTHUR:  How do you do, good lady.  I am Arthur, King of the Britons.
         Who's castle is that?
WOMAN:   King of the who?
                                  The Quest for the Holy Grail (Monty Python)

 /// 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/20220816135225.386FE1C0739%40moolenaar.net.

Raspunde prin e-mail lui