mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.0.0121
Problem: Setting 'cursorline' changes the curswant column. (Daniel Hahler) Solution: Add the P_RWINONLY flag. (closes #1297)
This commit is contained in:
@@ -435,8 +435,8 @@ struct vimoption
|
|||||||
|
|
||||||
/* when option changed, what to display: */
|
/* when option changed, what to display: */
|
||||||
#define P_RSTAT 0x1000 /* redraw status lines */
|
#define P_RSTAT 0x1000 /* redraw status lines */
|
||||||
#define P_RWIN 0x2000 /* redraw current window */
|
#define P_RWIN 0x2000 /* redraw current window and recompute text */
|
||||||
#define P_RBUF 0x4000 /* redraw current buffer */
|
#define P_RBUF 0x4000 /* redraw current buffer and recompute text */
|
||||||
#define P_RALL 0x6000 /* redraw all windows */
|
#define P_RALL 0x6000 /* redraw all windows */
|
||||||
#define P_RCLR 0x7000 /* clear and redraw all */
|
#define P_RCLR 0x7000 /* clear and redraw all */
|
||||||
|
|
||||||
@@ -457,6 +457,7 @@ struct vimoption
|
|||||||
#define P_CURSWANT 0x4000000L /* update curswant required; not needed when
|
#define P_CURSWANT 0x4000000L /* update curswant required; not needed when
|
||||||
* there is a redraw flag */
|
* there is a redraw flag */
|
||||||
#define P_NDNAME 0x8000000L /* only normal dir name chars allowed */
|
#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"
|
#define ISK_LATIN1 (char_u *)"@,48-57,_,192-255"
|
||||||
|
|
||||||
@@ -967,7 +968,7 @@ static struct vimoption options[] =
|
|||||||
(char_u *)NULL, PV_NONE,
|
(char_u *)NULL, PV_NONE,
|
||||||
#endif
|
#endif
|
||||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||||
{"cursorline", "cul", P_BOOL|P_VI_DEF|P_RWIN,
|
{"cursorline", "cul", P_BOOL|P_VI_DEF|P_RWINONLY,
|
||||||
#ifdef FEAT_SYN_HL
|
#ifdef FEAT_SYN_HL
|
||||||
(char_u *)VAR_WIN, PV_CUL,
|
(char_u *)VAR_WIN, PV_CUL,
|
||||||
#else
|
#else
|
||||||
@@ -9055,6 +9056,8 @@ check_redraw(long_u flags)
|
|||||||
changed_window_setting();
|
changed_window_setting();
|
||||||
if (flags & P_RBUF)
|
if (flags & P_RBUF)
|
||||||
redraw_curbuf_later(NOT_VALID);
|
redraw_curbuf_later(NOT_VALID);
|
||||||
|
if (flags & P_RWINONLY)
|
||||||
|
redraw_later(NOT_VALID);
|
||||||
if (doclear)
|
if (doclear)
|
||||||
redraw_all_later(CLEAR);
|
redraw_all_later(CLEAR);
|
||||||
else if (all)
|
else if (all)
|
||||||
|
@@ -273,3 +273,18 @@ func Test_gd_string_only()
|
|||||||
\ ]
|
\ ]
|
||||||
call XTest_goto_decl('gd', lines, 5, 10)
|
call XTest_goto_decl('gd', lines, 5, 10)
|
||||||
endfunc
|
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
|
||||||
|
|
||||||
|
@@ -764,6 +764,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
121,
|
||||||
/**/
|
/**/
|
||||||
120,
|
120,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user