To: vim_dev@googlegroups.com Subject: Patch 8.0.0121 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0121 Problem: Setting 'cursorline' changes the curswant column. (Daniel Hahler) Solution: Add the P_RWINONLY flag. (closes #1297) Files: src/option.c, src/testdir/test_goto.vim *** ../vim-8.0.0120/src/option.c 2016-11-29 22:10:44.221151470 +0100 --- src/option.c 2016-12-03 15:04:13.766727449 +0100 *************** *** 435,442 **** /* when option changed, what to display: */ #define P_RSTAT 0x1000 /* redraw status lines */ ! #define P_RWIN 0x2000 /* redraw current window */ ! #define P_RBUF 0x4000 /* redraw current buffer */ #define P_RALL 0x6000 /* redraw all windows */ #define P_RCLR 0x7000 /* clear and redraw all */ --- 435,442 ---- /* when option changed, what to display: */ #define P_RSTAT 0x1000 /* redraw status lines */ ! #define P_RWIN 0x2000 /* redraw current window and recompute text */ ! #define P_RBUF 0x4000 /* redraw current buffer and recompute text */ #define P_RALL 0x6000 /* redraw all windows */ #define P_RCLR 0x7000 /* clear and redraw all */ *************** *** 457,462 **** --- 457,463 ---- #define P_CURSWANT 0x4000000L /* update curswant required; not needed when * there is a redraw flag */ #define P_NDNAME 0x8000000L /* only normal dir name chars allowed */ + #define P_RWINONLY 0x10000000L /* only redraw current window */ #define ISK_LATIN1 (char_u *)"@,48-57,_,192-255" *************** *** 967,973 **** (char_u *)NULL, PV_NONE, #endif {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, ! {"cursorline", "cul", P_BOOL|P_VI_DEF|P_RWIN, #ifdef FEAT_SYN_HL (char_u *)VAR_WIN, PV_CUL, #else --- 968,974 ---- (char_u *)NULL, PV_NONE, #endif {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, ! {"cursorline", "cul", P_BOOL|P_VI_DEF|P_RWINONLY, #ifdef FEAT_SYN_HL (char_u *)VAR_WIN, PV_CUL, #else *************** *** 9055,9060 **** --- 9056,9063 ---- changed_window_setting(); if (flags & P_RBUF) redraw_curbuf_later(NOT_VALID); + if (flags & P_RWINONLY) + redraw_later(NOT_VALID); if (doclear) redraw_all_later(CLEAR); else if (all) *** ../vim-8.0.0120/src/testdir/test_goto.vim 2016-10-09 15:50:45.927932466 +0200 --- src/testdir/test_goto.vim 2016-12-03 15:03:54.458854912 +0100 *************** *** 273,275 **** --- 273,290 ---- \ ] call XTest_goto_decl('gd', lines, 5, 10) endfunc + + " Check that setting 'cursorline' does not change curswant + func Test_cursorline_keep_col() + new + call setline(1, ['long long long line', 'short line']) + normal ggfi + let pos = getcurpos() + normal j + set cursorline + normal k + call assert_equal(pos, getcurpos()) + bwipe! + set nocursorline + endfunc + *** ../vim-8.0.0120/src/version.c 2016-12-03 14:29:01.636589998 +0100 --- src/version.c 2016-12-03 15:01:47.067696037 +0100 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 121, /**/ -- hundred-and-one symptoms of being an internet addict: 86. E-mail Deficiency Depression (EDD) forces you to e-mail yourself. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///