diff options
author | ZviRackover <zvirack@gmail.com> | 2018-07-05 22:13:27 +0300 |
---|---|---|
committer | ZviRackover <zvirack@gmail.com> | 2018-08-13 18:07:40 +0300 |
commit | 7046258a384c400e0aab0691cddd10425f92ccf1 (patch) | |
tree | 2570eb8a77cb0d0beb7633aa72188b45cb7faaee /src | |
parent | ee5cc88a73401e4352660862631117c8319950f7 (diff) | |
download | rneovim-7046258a384c400e0aab0691cddd10425f92ccf1.tar.gz rneovim-7046258a384c400e0aab0691cddd10425f92ccf1.tar.bz2 rneovim-7046258a384c400e0aab0691cddd10425f92ccf1.zip |
Remove all occurrences of mb_off2cells
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/mbyte.c | 2 | ||||
-rw-r--r-- | src/nvim/mbyte.h | 1 | ||||
-rw-r--r-- | src/nvim/screen.c | 22 |
3 files changed, 12 insertions, 13 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index 15fe51cad1..b5ac400027 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -1829,7 +1829,7 @@ const char *mb_unescape(const char **const pp) */ bool mb_lefthalve(int row, int col) { - return (*mb_off2cells)(LineOffset[row] + col, + return utf_off2cells(LineOffset[row] + col, LineOffset[row] + screen_Columns) > 1; } diff --git a/src/nvim/mbyte.h b/src/nvim/mbyte.h index a21c08c7fe..5f48e1783e 100644 --- a/src/nvim/mbyte.h +++ b/src/nvim/mbyte.h @@ -53,7 +53,6 @@ enum { MAX_MCO = 6 }; #define mb_ptr2cells utf_ptr2cells #define mb_ptr2cells_len utf_ptr2cells_len #define mb_char2cells utf_char2cells -#define mb_off2cells utf_off2cells #define mb_head_off utf_head_off /// Flags for vimconv_T diff --git a/src/nvim/screen.c b/src/nvim/screen.c index f7fdc6060d..6728328e55 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -4243,10 +4243,10 @@ win_line ( * Don't do this for a window not at the right screen border. */ if (!(has_mbyte - && ((*mb_off2cells)(LineOffset[screen_row], + && (utf_off2cells(LineOffset[screen_row], LineOffset[screen_row] + screen_Columns) == 2 - || (*mb_off2cells)(LineOffset[screen_row - 1] + || utf_off2cells(LineOffset[screen_row - 1] + (int)Columns - 2, LineOffset[screen_row] + screen_Columns) == 2)) @@ -4304,7 +4304,7 @@ static int char_needs_redraw(int off_from, int off_to, int cols) return (cols > 0 && ((schar_cmp(ScreenLines[off_from], ScreenLines[off_to]) || ScreenAttrs[off_from] != ScreenAttrs[off_to] - || ((*mb_off2cells)(off_from, off_from + cols) > 1 + || (utf_off2cells(off_from, off_from + cols) > 1 && schar_cmp(ScreenLines[off_from + 1], ScreenLines[off_to + 1]))) || p_wd < 0)); @@ -4384,7 +4384,7 @@ static void screen_line(int row, int coloff, int endcol, while (col < endcol) { if (has_mbyte && (col + 1 < endcol)) - char_cells = (*mb_off2cells)(off_from, max_off_from); + char_cells = utf_off2cells(off_from, max_off_from); else char_cells = 1; @@ -4405,10 +4405,10 @@ static void screen_line(int row, int coloff, int endcol, // char over the left halve of an existing one if (has_mbyte && col + char_cells == endcol && ((char_cells == 1 - && (*mb_off2cells)(off_to, max_off_to) > 1) + && utf_off2cells(off_to, max_off_to) > 1) || (char_cells == 2 - && (*mb_off2cells)(off_to, max_off_to) == 1 - && (*mb_off2cells)(off_to + 1, max_off_to) > 1))) { + && utf_off2cells(off_to, max_off_to) == 1 + && utf_off2cells(off_to + 1, max_off_to) > 1))) { clear_next = true; } @@ -5394,15 +5394,15 @@ void screen_puts_len(char_u *text, int textlen, int row, int col, int attr) // character with a one-cell character, need to clear the next // cell. Also when overwriting the left halve of a two-cell char // with the right halve of a two-cell char. Do this only once - // (mb_off2cells() may return 2 on the right halve). + // (utf8_off2cells() may return 2 on the right halve). if (clear_next_cell) { clear_next_cell = false; } else if ((len < 0 ? ptr[mbyte_blen] == NUL : ptr + mbyte_blen >= text + len) - && ((mbyte_cells == 1 && (*mb_off2cells)(off, max_off) > 1) + && ((mbyte_cells == 1 && utf_off2cells(off, max_off) > 1) || (mbyte_cells == 2 - && (*mb_off2cells)(off, max_off) == 1 - && (*mb_off2cells)(off + 1, max_off) > 1))) { + && utf_off2cells(off, max_off) == 1 + && utf_off2cells(off + 1, max_off) > 1))) { clear_next_cell = true; } |