summaryrefslogtreecommitdiffstats
path: root/src/normal.c
diff options
context:
space:
mode:
authorChrist van Willegen - van Noort <github.com@vanwillegen-vannoort.nl>2024-05-17 18:49:27 +0200
committerChristian Brabandt <cb@256bit.org>2024-05-17 18:52:45 +0200
commit8e4c4c7d87def2b100a5d64dc518ef85d9de8765 (patch)
tree52e523d63196ca353a18d0fb13d2f98ffbd80ca3 /src/normal.c
parentcf78d0df51f2737f278a2410f166862001d875ae (diff)
patch 9.1.0418: Cannot move to previous/next rare wordv9.1.0418
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>
Diffstat (limited to 'src/normal.c')
-rw-r--r--src/normal.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/normal.c b/src/normal.c
index fef282647f..580eb72298 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -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;