0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 9.1.0418: Cannot move to previous/next rare word

Problem:  Cannot move to previous/next rare word
          (Colin Kennedy)
Solution: Add the ]r and [r motions (Christ van Willegen)

fixes: #14773
closes: #14780

Signed-off-by: Christ van Willegen - van Noort <github.com@vanwillegen-vannoort.nl>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christ van Willegen - van Noort
2024-05-17 18:49:27 +02:00
committed by Christian Brabandt
parent cf78d0df51
commit 8e4c4c7d87
14 changed files with 108 additions and 15 deletions

View File

@@ -2593,7 +2593,7 @@ nv_zg_zw(cmdarg_T *cap, int nchar)
// off this fails and find_ident_under_cursor() is
// used below.
emsg_off++;
len = spell_move_to(curwin, FORWARD, TRUE, TRUE, NULL);
len = spell_move_to(curwin, FORWARD, SMT_ALL, TRUE, NULL);
emsg_off--;
if (len != 0 && curwin->w_cursor.col <= pos.col)
ptr = ml_get_pos(&curwin->w_cursor);
@@ -4529,13 +4529,15 @@ nv_brackets(cmdarg_T *cap)
#endif
#ifdef FEAT_SPELL
// "[s", "[S", "]s" and "]S": move to next spell error.
else if (cap->nchar == 's' || cap->nchar == 'S')
// "[r", "[s", "[S", "]r", "]s" and "]S": move to next spell error.
else if (cap->nchar == 'r' || cap->nchar == 's' || cap->nchar == 'S')
{
setpcmark();
for (n = 0; n < cap->count1; ++n)
if (spell_move_to(curwin, cap->cmdchar == ']' ? FORWARD : BACKWARD,
cap->nchar == 's' ? TRUE : FALSE, FALSE, NULL) == 0)
cap->nchar == 's' ? SMT_ALL :
cap->nchar == 'r' ? SMT_RARE :
SMT_BAD, FALSE, NULL) == 0)
{
clearopbeep(cap->oap);
break;