Patch 9.0.0218

4 views
Skip to first unread message

Bram Moolenaar

unread,
Aug 16, 2022, 9:52:37 AM8/16/22
to vim...@googlegroups.com

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 -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages