aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-08-28 23:43:04 +0200
committerJustin M. Keyes <justinkz@gmail.com>2018-08-28 23:43:04 +0200
commit461d46d8ace1b6950bf2733de9cb2b290453d86d (patch)
treea592acf9f95e8c60cc396f48ac4bf73656c0846c /src/nvim/normal.c
parent885ca3b7a60b79feb1d4c9e54265c8b543d4f245 (diff)
parenta2403a0ed9afdfaea7abb5555dbdf555b56eff9a (diff)
downloadrneovim-461d46d8ace1b6950bf2733de9cb2b290453d86d.tar.gz
rneovim-461d46d8ace1b6950bf2733de9cb2b290453d86d.tar.bz2
rneovim-461d46d8ace1b6950bf2733de9cb2b290453d86d.zip
Merge #8863 'refactor: Remove mb_head_off()'
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index afddd548a3..0bf93ee001 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -2858,9 +2858,10 @@ static void find_start_of_word(pos_T *pos)
while (pos->col > 0) {
col = pos->col - 1;
- col -= (*mb_head_off)(line, line + col);
- if (get_mouse_class(line + col) != cclass)
+ col -= utf_head_off(line, line + col);
+ if (get_mouse_class(line + col) != cclass) {
break;
+ }
pos->col = col;
}
}
@@ -2877,8 +2878,8 @@ static void find_end_of_word(pos_T *pos)
line = ml_get(pos->lnum);
if (*p_sel == 'e' && pos->col > 0) {
- --pos->col;
- pos->col -= (*mb_head_off)(line, line + pos->col);
+ pos->col--;
+ pos->col -= utf_head_off(line, line + pos->col);
}
cclass = get_mouse_class(line + pos->col);
while (line[pos->col] != NUL) {
@@ -3094,9 +3095,9 @@ size_t find_ident_at_pos(win_T *wp, linenr_T lnum, colnr_T startcol,
// When starting on a ']' count it, so that we include the '['.
bn = ptr[col] == ']';
- /*
- * 2. Back up to start of identifier/string.
- */
+ //
+ // 2. Back up to start of identifier/string.
+ //
// Remember class of character under cursor.
if ((find_type & FIND_EVAL) && ptr[col] == ']') {
this_class = mb_get_class((char_u *)"a");
@@ -3129,7 +3130,7 @@ size_t find_ident_at_pos(win_T *wp, linenr_T lnum, colnr_T startcol,
}
if (ptr[col] == NUL || (i == 0 && this_class != 2)) {
- // didn't find an identifier or string
+ // Didn't find an identifier or string.
if (find_type & FIND_STRING) {
EMSG(_("E348: No string under cursor"));
} else {