]> granicus.if.org Git - vim/commitdiff
patch 7.4.2322 v7.4.2322
authorBram Moolenaar <Bram@vim.org>
Sun, 4 Sep 2016 12:34:28 +0000 (14:34 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 4 Sep 2016 12:34:28 +0000 (14:34 +0200)
Problem:    Access memory beyond the end of the line. (Dominique Pelle)
Solution:   Adjust the cursor column.

src/move.c
src/testdir/test_normal.vim
src/version.c

index 6322acf989c9f4bc975395cd7d8817742b38717d..a4d5f82997b648c09b6ac82256bbe8f1c0e214d0 100644 (file)
@@ -2479,6 +2479,7 @@ onepage(int dir, long count)
     foldAdjustCursor();
 #endif
     cursor_correct();
+    check_cursor_col();
     if (retval == OK)
        beginline(BL_SOL | BL_FIX);
     curwin->w_valid &= ~(VALID_WCOL|VALID_WROW|VALID_VIRTCOL);
index ff6710218d544f2ece42c9d8ebf18ac64cb29437..98cb7754bb14ef03f655e47a5b9bcc7a58f0d0d6 100644 (file)
@@ -398,6 +398,15 @@ func! Test_normal14_page()
   bw!
 endfu
 
+func! Test_normal14_page_eol()
+  10new
+  norm oxxxxxxx
+  exe "norm 2\<c-f>"
+  " check with valgrind that cursor is put back in column 1
+  exe "norm 2\<c-b>"
+  bw!
+endfunc
+
 func! Test_normal15_z_scroll_vert()
   " basic test for z commands that scroll the window
   call Setup_NewWindow()
index 5628a9dce3b451bf6f5f434c98c557d9330c19d7..155d9dda2071ce50ca3c0a081d3f3d930ebdeeed 100644 (file)
@@ -763,6 +763,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2322,
 /**/
     2321,
 /**/