aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
authorZviRackover <zvirack@gmail.com>2018-08-15 22:46:48 +0300
committerZviRackover <zvirack@gmail.com>2018-08-16 06:03:49 +0300
commit30392b635689a5f25421c17ead79e521863c8b57 (patch)
treedcfc160cd10b09de6a7ededd4d241196b24ac122 /src/nvim/edit.c
parent2bddc4ca54e31a14b7e9799beda134217ae867e7 (diff)
downloadrneovim-30392b635689a5f25421c17ead79e521863c8b57.tar.gz
rneovim-30392b635689a5f25421c17ead79e521863c8b57.tar.bz2
rneovim-30392b635689a5f25421c17ead79e521863c8b57.zip
Remove has_mbyte from lines near changes in parent commit
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r--src/nvim/edit.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 82c74a00c5..c60f85ed4c 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -1556,13 +1556,10 @@ void display_dollar(colnr_T col)
save_col = curwin->w_cursor.col;
curwin->w_cursor.col = col;
- if (has_mbyte) {
- char_u *p;
- /* If on the last byte of a multi-byte move to the first byte. */
- p = get_cursor_line_ptr();
- curwin->w_cursor.col -= utf_head_off(p, p + col);
- }
+ /* If on the last byte of a multi-byte move to the first byte. */
+ char_u *p = get_cursor_line_ptr();
+ curwin->w_cursor.col -= utf_head_off(p, p + col);
curs_columns(FALSE); /* recompute w_wrow and w_wcol */
if (curwin->w_wcol < curwin->w_width) {
edit_putchar('$', FALSE);
@@ -4589,22 +4586,15 @@ static int ins_complete(int c, bool enable_pum)
} else {
/* Search the point of change class of multibyte character
* or not a word single byte character backward. */
- if (has_mbyte) {
- int base_class;
- int head_off;
-
- startcol -= utf_head_off(line, line + startcol);
- base_class = mb_get_class(line + startcol);
- while (--startcol >= 0) {
- head_off = utf_head_off(line, line + startcol);
- if (base_class != mb_get_class(line + startcol
- - head_off))
- break;
- startcol -= head_off;
- }
- } else
- while (--startcol >= 0 && vim_iswordc(line[startcol]))
- ;
+ startcol -= utf_head_off(line, line + startcol);
+ int base_class = mb_get_class(line + startcol);
+ while (--startcol >= 0) {
+ int head_off = utf_head_off(line, line + startcol);
+ if (base_class != mb_get_class(line + startcol
+ - head_off))
+ break;
+ startcol -= head_off;
+ }
compl_col += ++startcol;
compl_length = (int)curs_col - startcol;
if (compl_length == 1) {