mirror of
https://github.com/neovim/neovim.git
synced 2025-09-23 03:28:33 +00:00
Remove all occurrences of mb_off2cells
This commit is contained in:
@@ -1829,7 +1829,7 @@ const char *mb_unescape(const char **const pp)
|
|||||||
*/
|
*/
|
||||||
bool mb_lefthalve(int row, int col)
|
bool mb_lefthalve(int row, int col)
|
||||||
{
|
{
|
||||||
return (*mb_off2cells)(LineOffset[row] + col,
|
return utf_off2cells(LineOffset[row] + col,
|
||||||
LineOffset[row] + screen_Columns) > 1;
|
LineOffset[row] + screen_Columns) > 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -53,7 +53,6 @@ enum { MAX_MCO = 6 };
|
|||||||
#define mb_ptr2cells utf_ptr2cells
|
#define mb_ptr2cells utf_ptr2cells
|
||||||
#define mb_ptr2cells_len utf_ptr2cells_len
|
#define mb_ptr2cells_len utf_ptr2cells_len
|
||||||
#define mb_char2cells utf_char2cells
|
#define mb_char2cells utf_char2cells
|
||||||
#define mb_off2cells utf_off2cells
|
|
||||||
#define mb_head_off utf_head_off
|
#define mb_head_off utf_head_off
|
||||||
|
|
||||||
/// Flags for vimconv_T
|
/// Flags for vimconv_T
|
||||||
|
@@ -4243,10 +4243,10 @@ win_line (
|
|||||||
* Don't do this for a window not at the right screen border.
|
* Don't do this for a window not at the right screen border.
|
||||||
*/
|
*/
|
||||||
if (!(has_mbyte
|
if (!(has_mbyte
|
||||||
&& ((*mb_off2cells)(LineOffset[screen_row],
|
&& (utf_off2cells(LineOffset[screen_row],
|
||||||
LineOffset[screen_row] + screen_Columns)
|
LineOffset[screen_row] + screen_Columns)
|
||||||
== 2
|
== 2
|
||||||
|| (*mb_off2cells)(LineOffset[screen_row - 1]
|
|| utf_off2cells(LineOffset[screen_row - 1]
|
||||||
+ (int)Columns - 2,
|
+ (int)Columns - 2,
|
||||||
LineOffset[screen_row] + screen_Columns)
|
LineOffset[screen_row] + screen_Columns)
|
||||||
== 2))
|
== 2))
|
||||||
@@ -4304,7 +4304,7 @@ static int char_needs_redraw(int off_from, int off_to, int cols)
|
|||||||
return (cols > 0
|
return (cols > 0
|
||||||
&& ((schar_cmp(ScreenLines[off_from], ScreenLines[off_to])
|
&& ((schar_cmp(ScreenLines[off_from], ScreenLines[off_to])
|
||||||
|| ScreenAttrs[off_from] != ScreenAttrs[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],
|
&& schar_cmp(ScreenLines[off_from + 1],
|
||||||
ScreenLines[off_to + 1])))
|
ScreenLines[off_to + 1])))
|
||||||
|| p_wd < 0));
|
|| p_wd < 0));
|
||||||
@@ -4384,7 +4384,7 @@ static void screen_line(int row, int coloff, int endcol,
|
|||||||
|
|
||||||
while (col < endcol) {
|
while (col < endcol) {
|
||||||
if (has_mbyte && (col + 1 < 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
|
else
|
||||||
char_cells = 1;
|
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
|
// char over the left halve of an existing one
|
||||||
if (has_mbyte && col + char_cells == endcol
|
if (has_mbyte && col + char_cells == endcol
|
||||||
&& ((char_cells == 1
|
&& ((char_cells == 1
|
||||||
&& (*mb_off2cells)(off_to, max_off_to) > 1)
|
&& utf_off2cells(off_to, max_off_to) > 1)
|
||||||
|| (char_cells == 2
|
|| (char_cells == 2
|
||||||
&& (*mb_off2cells)(off_to, max_off_to) == 1
|
&& utf_off2cells(off_to, max_off_to) == 1
|
||||||
&& (*mb_off2cells)(off_to + 1, max_off_to) > 1))) {
|
&& utf_off2cells(off_to + 1, max_off_to) > 1))) {
|
||||||
clear_next = true;
|
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
|
// character with a one-cell character, need to clear the next
|
||||||
// cell. Also when overwriting the left halve of a two-cell char
|
// 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
|
// 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) {
|
if (clear_next_cell) {
|
||||||
clear_next_cell = false;
|
clear_next_cell = false;
|
||||||
} else if ((len < 0 ? ptr[mbyte_blen] == NUL
|
} else if ((len < 0 ? ptr[mbyte_blen] == NUL
|
||||||
: ptr + mbyte_blen >= text + len)
|
: 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
|
|| (mbyte_cells == 2
|
||||||
&& (*mb_off2cells)(off, max_off) == 1
|
&& utf_off2cells(off, max_off) == 1
|
||||||
&& (*mb_off2cells)(off + 1, max_off) > 1))) {
|
&& utf_off2cells(off + 1, max_off) > 1))) {
|
||||||
clear_next_cell = true;
|
clear_next_cell = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user