]> granicus.if.org Git - vim/commitdiff
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn' v8.1.0754
authorBram Moolenaar <Bram@vim.org>
Tue, 15 Jan 2019 20:12:57 +0000 (21:12 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 15 Jan 2019 20:12:57 +0000 (21:12 +0100)
Problem:    Preferred column is lost when setting 'cursorcolumn'.
Solution:   Change option flag to P_RWINONLY. (Takayuki Kurosawa,
            closes #3806)

src/option.c
src/testdir/test_cursor_func.vim
src/version.c

index 414e65a1f1a4fc80436ba8b3f1e7783ef3bd999f..ca3e3d8308d3b8dd267dfb6c1826e13da06bace1 100644 (file)
@@ -989,7 +989,7 @@ static struct vimoption options[] =
     {"cursorbind",  "crb",  P_BOOL|P_VI_DEF,
                            (char_u *)VAR_WIN, PV_CRBIND,
                            {(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
-    {"cursorcolumn", "cuc", P_BOOL|P_VI_DEF|P_RWIN,
+    {"cursorcolumn", "cuc", P_BOOL|P_VI_DEF|P_RWINONLY,
 #ifdef FEAT_SYN_HL
                            (char_u *)VAR_WIN, PV_CUC,
 #else
index d784e3678b991358e4cf7d0ecdde00319250f536..a41cc7d005a6ddb63fed42591ca070a3db8863d9 100644 (file)
@@ -46,3 +46,23 @@ func Test_curswant_with_autocommand()
   quit!
 endfunc
 
+" Tests for behavior of curswant with cursorcolumn/line
+func Test_curswant_with_cursorcolumn()
+  new
+  call setline(1, ['01234567', ''])
+  exe "normal! ggf6j"
+  call assert_equal(6, winsaveview().curswant)
+  set cursorcolumn
+  call assert_equal(6, winsaveview().curswant)
+  quit!
+endfunc
+
+func Test_curswant_with_cursorline()
+  new
+  call setline(1, ['01234567', ''])
+  exe "normal! ggf6j"
+  call assert_equal(6, winsaveview().curswant)
+  set cursorline
+  call assert_equal(6, winsaveview().curswant)
+  quit!
+endfunc
index 708f96f9cfecfd3510706216f48a30b035e302e5..cf58605671099b7479eba7888afcba6736f7942c 100644 (file)
@@ -795,6 +795,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    754,
 /**/
     753,
 /**/