aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/search.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/search.c')
-rw-r--r--src/nvim/search.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/src/nvim/search.c b/src/nvim/search.c
index 75862e1136..8c56eda7cf 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -2417,32 +2417,20 @@ static int cls(void)
int c;
c = gchar_cursor();
- if (p_altkeymap && c == F_BLANK)
+ if (p_altkeymap && c == F_BLANK) {
return 0;
- if (c == ' ' || c == '\t' || c == NUL)
- return 0;
- if (enc_dbcs != 0 && c > 0xFF) {
- /* If cls_bigword, report multi-byte chars as class 1. */
- if (enc_dbcs == DBCS_KOR && cls_bigword)
- return 1;
-
- /* process code leading/trailing bytes */
- return dbcs_class(((unsigned)c >> 8), (c & 0xFF));
}
- if (enc_utf8) {
- c = utf_class(c);
- if (c != 0 && cls_bigword)
- return 1;
- return c;
+ if (c == ' ' || c == '\t' || c == NUL) {
+ return 0;
}
- /* If cls_bigword is TRUE, report all non-blanks as class 1. */
- if (cls_bigword)
- return 1;
+ c = utf_class(c);
- if (vim_iswordc(c))
- return 2;
- return 1;
+ // If cls_bigword is TRUE, report all non-blanks as class 1.
+ if (c != 0 && cls_bigword) {
+ return 1;
+ }
+ return c;
}
/*