From 8e4c4c7d87def2b100a5d64dc518ef85d9de8765 Mon Sep 17 00:00:00 2001 From: Christ van Willegen - van Noort Date: Fri, 17 May 2024 18:49:27 +0200 Subject: 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 Signed-off-by: Christian Brabandt --- src/spell.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/spell.c') diff --git a/src/spell.c b/src/spell.c index 43c521dde6..3ae484c145 100644 --- a/src/spell.c +++ b/src/spell.c @@ -1336,7 +1336,7 @@ no_spell_checking(win_T *wp) spell_move_to( win_T *wp, int dir, // FORWARD or BACKWARD - int allwords, // TRUE for "[s"/"]s", FALSE for "[S"/"]S" + smt_T behaviour, // Behaviour of the function int curline, hlf_T *attrp) // return: attributes of bad word or NULL // (only when "dir" is FORWARD) @@ -1441,7 +1441,9 @@ spell_move_to( if (attr != HLF_COUNT) { // We found a bad word. Check the attribute. - if (allwords || attr == HLF_SPB) + if (behaviour == SMT_ALL + || (behaviour == SMT_BAD && attr == HLF_SPB) + || (behaviour == SMT_RARE && attr == HLF_SPR)) { // When searching forward only accept a bad word after // the cursor. -- cgit v1.2.3