aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-05-18 07:09:05 +0800
committerGitHub <noreply@github.com>2024-05-18 07:09:05 +0800
commit62eb7e79a5f9b5f476f034b5446d2972c840ef87 (patch)
tree7d4ad0a263d658fb04c5f461e8f2a1b72bdd71df /src/nvim/normal.c
parent5947f249f838eb56f8d186e69f4f58e9dee009ed (diff)
downloadrneovim-62eb7e79a5f9b5f476f034b5446d2972c840ef87.tar.gz
rneovim-62eb7e79a5f9b5f476f034b5446d2972c840ef87.tar.bz2
rneovim-62eb7e79a5f9b5f476f034b5446d2972c840ef87.zip
vim-patch:9.1.0418: Cannot move to previous/next rare word (#28822)
Problem: Cannot move to previous/next rare word (Colin Kennedy) Solution: Add the ]r and [r motions (Christ van Willegen) fixes: vim/vim#14773 closes: vim/vim#14780 https://github.com/vim/vim/commit/8e4c4c7d87def2b100a5d64dc518ef85d9de8765 Co-authored-by: Christ van Willegen - van Noort <github.com@vanwillegen-vannoort.nl>
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 2f1477b9d5..02bd3d05c1 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -2710,7 +2710,7 @@ static int 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);
@@ -4272,12 +4272,15 @@ static void nv_brackets(cmdarg_T *cap)
cap->count1) == false) {
clearopbeep(cap->oap);
}
- } else if (cap->nchar == 's' || cap->nchar == 'S') {
- // "[s", "[S", "]s" and "]S": move to next spell error.
+ } else if (cap->nchar == 'r' || cap->nchar == 's' || cap->nchar == 'S') {
+ // "[r", "[s", "[S", "]r", "]s" and "]S": move to next spell error.
setpcmark();
for (n = 0; n < cap->count1; n++) {
if (spell_move_to(curwin, cap->cmdchar == ']' ? FORWARD : BACKWARD,
- cap->nchar == 's', false, NULL) == 0) {
+ cap->nchar == 's'
+ ? SMT_ALL
+ : cap->nchar == 'r' ? SMT_RARE : SMT_BAD,
+ false, NULL) == 0) {
clearopbeep(cap->oap);
break;
}