diff options
author | ZviRackover <zvirack@gmail.com> | 2018-06-30 16:21:37 +0300 |
---|---|---|
committer | ZviRackover <zvirack@gmail.com> | 2018-08-06 20:48:07 +0300 |
commit | 071aab51488e03a0e09a0a60aec6c0abc0277279 (patch) | |
tree | 6323eb69ad229bb7c9c43ee26c4fa566ef6fd6f8 /src/nvim/misc1.c | |
parent | cd3b2e4b6bea9501b3bd7ddf7b4d7ca31f1e6dd5 (diff) | |
download | rneovim-071aab51488e03a0e09a0a60aec6c0abc0277279.tar.gz rneovim-071aab51488e03a0e09a0a60aec6c0abc0277279.tar.bz2 rneovim-071aab51488e03a0e09a0a60aec6c0abc0277279.zip |
Remove some occrrences of enc_utf8 and has_mbyte
Removing uses and related dead code in the locallity of changes of
the two parent commits.
Diffstat (limited to 'src/nvim/misc1.c')
-rw-r--r-- | src/nvim/misc1.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index 01f9cb9e32..72490a376f 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -701,13 +701,12 @@ open_line ( replace_push(NUL); /* end of extra blanks */ if (curbuf->b_p_ai || (flags & OPENLINE_DELSPACES)) { while ((*p_extra == ' ' || *p_extra == '\t') - && (!enc_utf8 - || !utf_iscomposing(utf_ptr2char(p_extra + 1))) - ) { - if (REPLACE_NORMAL(State)) + && !utf_iscomposing(utf_ptr2char(p_extra + 1))) { + if (REPLACE_NORMAL(State)) { replace_push(*p_extra); - ++p_extra; - ++less_cols_off; + } + p_extra++; + less_cols_off++; } } if (*p_extra != NUL) { @@ -1749,12 +1748,7 @@ del_lines ( int gchar_pos(pos_T *pos) { - char_u *ptr = ml_get_pos(pos); - - if (has_mbyte) { - return utf_ptr2char(ptr); - } - return (int)(*ptr); + return utf_ptr2char(ml_get_pos(pos)); } /* @@ -2390,12 +2384,12 @@ int get_keystroke(void) } break; } - if (has_mbyte) { - if (MB_BYTE2LEN(n) > len) - continue; /* more bytes to get */ - buf[len >= buflen ? buflen - 1 : len] = NUL; - n = utf_ptr2char(buf); + if (MB_BYTE2LEN(n) > len) { + // more bytes to get. + continue; } + buf[len >= buflen ? buflen - 1 : len] = NUL; + n = utf_ptr2char(buf); #ifdef UNIX if (n == intr_char) n = ESC; |