Skip to content

Commit b73fa62

Browse files
committed
patch 8.0.1419: cursor column is not updated after ]s
Problem: Cursor column is not updated after ]s. (Gary Johnson) Solution: Set the curswant flag.
1 parent ae6f865 commit b73fa62

4 files changed

Lines changed: 38 additions & 0 deletions

File tree

src/evalfunc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11173,7 +11173,10 @@ f_spellbadword(typval_T *argvars UNUSED, typval_T *rettv)
1117311173
/* Find the start and length of the badly spelled word. */
1117411174
len = spell_move_to(curwin, FORWARD, TRUE, TRUE, &attr);
1117511175
if (len != 0)
11176+
{
1117611177
word = ml_get_cursor();
11178+
curwin->w_set_curswant = TRUE;
11179+
}
1117711180
}
1117811181
else if (curwin->w_p_spell && *curbuf->b_s.b_p_spl != NUL)
1117911182
{

src/normal.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6814,6 +6814,8 @@ nv_brackets(cmdarg_T *cap)
68146814
clearopbeep(cap->oap);
68156815
break;
68166816
}
6817+
else
6818+
curwin->w_set_curswant = TRUE;
68176819
# ifdef FEAT_FOLDING
68186820
if (cap->oap->op_type == OP_NOP && (fdo_flags & FDO_SEARCH) && KeyTyped)
68196821
foldOpenCursor();

src/testdir/test_spell.vim

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,37 @@ func Test_wrap_search()
2828
set nospell
2929
endfunc
3030

31+
func Test_curswant()
32+
new
33+
call setline(1, ['Another plong line', 'abcdefghijklmnopq'])
34+
set spell wrapscan
35+
normal 0]s
36+
call assert_equal('plong', expand('<cword>'))
37+
normal j
38+
call assert_equal(9, getcurpos()[2])
39+
normal 0[s
40+
call assert_equal('plong', expand('<cword>'))
41+
normal j
42+
call assert_equal(9, getcurpos()[2])
43+
44+
normal 0]S
45+
call assert_equal('plong', expand('<cword>'))
46+
normal j
47+
call assert_equal(9, getcurpos()[2])
48+
normal 0[S
49+
call assert_equal('plong', expand('<cword>'))
50+
normal j
51+
call assert_equal(9, getcurpos()[2])
52+
53+
normal 1G0
54+
call assert_equal('plong', spellbadword()[0])
55+
normal j
56+
call assert_equal(9, getcurpos()[2])
57+
58+
bwipe!
59+
set nospell
60+
endfunc
61+
3162
func Test_z_equal_on_invalid_utf8_word()
3263
split
3364
set spell

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,8 @@ static char *(features[]) =
771771

772772
static int included_patches[] =
773773
{ /* Add new patch number below this line */
774+
/**/
775+
1419,
774776
/**/
775777
1418,
776778
/**/

0 commit comments

Comments
 (0)