mirror of
https://github.com/neovim/neovim.git
synced 2025-09-08 12:28:18 +00:00
screen: Get rid of ScreenLines2 as it is no longer used
Should also fix some PVS warnings in process.
This commit is contained in:
@@ -158,10 +158,6 @@ EXTERN u8char_T *ScreenLinesC[MAX_MCO]; /* composing characters */
|
|||||||
EXTERN int Screen_mco INIT(= 0); /* value of p_mco used when
|
EXTERN int Screen_mco INIT(= 0); /* value of p_mco used when
|
||||||
allocating ScreenLinesC[] */
|
allocating ScreenLinesC[] */
|
||||||
|
|
||||||
/* Only used for euc-jp: Second byte of a character that starts with 0x8e.
|
|
||||||
* These are single-width. */
|
|
||||||
EXTERN schar_T *ScreenLines2 INIT(= NULL);
|
|
||||||
|
|
||||||
EXTERN int screen_Rows INIT(= 0); /* actual size of ScreenLines[] */
|
EXTERN int screen_Rows INIT(= 0); /* actual size of ScreenLines[] */
|
||||||
EXTERN int screen_Columns INIT(= 0); /* actual size of ScreenLines[] */
|
EXTERN int screen_Columns INIT(= 0); /* actual size of ScreenLines[] */
|
||||||
|
|
||||||
|
@@ -24,8 +24,6 @@
|
|||||||
* cells the next byte in ScreenLines[] is 0.
|
* cells the next byte in ScreenLines[] is 0.
|
||||||
* ScreenLinesC[][] contain up to 'maxcombine' composing characters
|
* ScreenLinesC[][] contain up to 'maxcombine' composing characters
|
||||||
* (drawn on top of the first character). There is 0 after the last one used.
|
* (drawn on top of the first character). There is 0 after the last one used.
|
||||||
* ScreenLines2[] is only used for euc-jp to store the second byte if the
|
|
||||||
* first byte is 0x8e (single-width character).
|
|
||||||
*
|
*
|
||||||
* The screen_*() functions write to the screen and handle updating
|
* The screen_*() functions write to the screen and handle updating
|
||||||
* ScreenLines[].
|
* ScreenLines[].
|
||||||
@@ -1918,12 +1916,10 @@ static void fold_line(win_T *wp, long fold_count, foldinfo_T *foldinfo, linenr_T
|
|||||||
}
|
}
|
||||||
if (cells > 1)
|
if (cells > 1)
|
||||||
ScreenLines[idx + 1] = 0;
|
ScreenLines[idx + 1] = 0;
|
||||||
} else if (enc_dbcs == DBCS_JPNU && *p == 0x8e)
|
} else if (cells > 1) {
|
||||||
/* double-byte single width character */
|
// Double-width character.
|
||||||
ScreenLines2[idx] = p[1];
|
|
||||||
else if (cells > 1)
|
|
||||||
/* double-width character */
|
|
||||||
ScreenLines[idx + 1] = p[1];
|
ScreenLines[idx + 1] = p[1];
|
||||||
|
}
|
||||||
col += cells;
|
col += cells;
|
||||||
idx += cells;
|
idx += cells;
|
||||||
p += c_len;
|
p += c_len;
|
||||||
@@ -4092,23 +4088,18 @@ win_line (
|
|||||||
--col;
|
--col;
|
||||||
}
|
}
|
||||||
ScreenLines[off] = c;
|
ScreenLines[off] = c;
|
||||||
if (enc_dbcs == DBCS_JPNU) {
|
|
||||||
if ((mb_c & 0xff00) == 0x8e00)
|
|
||||||
ScreenLines[off] = 0x8e;
|
|
||||||
ScreenLines2[off] = mb_c & 0xff;
|
|
||||||
} else if (enc_utf8) {
|
|
||||||
if (mb_utf8) {
|
if (mb_utf8) {
|
||||||
int i;
|
|
||||||
|
|
||||||
ScreenLinesUC[off] = mb_c;
|
ScreenLinesUC[off] = mb_c;
|
||||||
if ((c & 0xff) == 0)
|
if ((c & 0xff) == 0) {
|
||||||
ScreenLines[off] = 0x80; /* avoid storing zero */
|
ScreenLines[off] = 0x80; // Avoid storing zero.
|
||||||
for (i = 0; i < Screen_mco; ++i) {
|
}
|
||||||
|
for (int i = 0; i < Screen_mco; i++) {
|
||||||
ScreenLinesC[i][off] = u8cc[i];
|
ScreenLinesC[i][off] = u8cc[i];
|
||||||
if (u8cc[i] == 0)
|
if (u8cc[i] == 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
|
} else {
|
||||||
ScreenLinesUC[off] = 0;
|
ScreenLinesUC[off] = 0;
|
||||||
}
|
}
|
||||||
if (multi_attr) {
|
if (multi_attr) {
|
||||||
@@ -4381,22 +4372,13 @@ static int comp_char_differs(int off_from, int off_to)
|
|||||||
static int char_needs_redraw(int off_from, int off_to, int cols)
|
static int char_needs_redraw(int off_from, int off_to, int cols)
|
||||||
{
|
{
|
||||||
return (cols > 0
|
return (cols > 0
|
||||||
&& ((ScreenLines[off_from] != ScreenLines[off_to]
|
&& (ScreenLines[off_from] != ScreenLines[off_to]
|
||||||
|| ScreenAttrs[off_from] != ScreenAttrs[off_to])
|
|| ScreenAttrs[off_from] != ScreenAttrs[off_to]
|
||||||
|
|| ScreenLinesUC[off_from] != ScreenLinesUC[off_to]
|
||||||
|| (enc_dbcs != 0
|
|
||||||
&& MB_BYTE2LEN(ScreenLines[off_from]) > 1
|
|
||||||
&& (enc_dbcs == DBCS_JPNU && ScreenLines[off_from] == 0x8e
|
|
||||||
? ScreenLines2[off_from] != ScreenLines2[off_to]
|
|
||||||
: (cols > 1 && ScreenLines[off_from + 1]
|
|
||||||
!= ScreenLines[off_to + 1])))
|
|
||||||
|| (enc_utf8
|
|
||||||
&& (ScreenLinesUC[off_from] != ScreenLinesUC[off_to]
|
|
||||||
|| (ScreenLinesUC[off_from] != 0
|
|| (ScreenLinesUC[off_from] != 0
|
||||||
&& comp_char_differs(off_from, off_to))
|
&& comp_char_differs(off_from, off_to))
|
||||||
|| ((*mb_off2cells)(off_from, off_from + cols) > 1
|
|| (utf_off2cells(off_from, off_from + cols) > 1
|
||||||
&& ScreenLines[off_from + 1]
|
&& ScreenLines[off_from + 1] != ScreenLines[off_to + 1])
|
||||||
!= ScreenLines[off_to + 1])))
|
|
||||||
|| p_wd < 0));
|
|| p_wd < 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4497,9 +4479,6 @@ static void screen_line(int row, int coloff, int endcol,
|
|||||||
ScreenLines[off_to + 2] = 0;
|
ScreenLines[off_to + 2] = 0;
|
||||||
redraw_next = TRUE;
|
redraw_next = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enc_dbcs == DBCS_JPNU)
|
|
||||||
ScreenLines2[off_to] = ScreenLines2[off_from];
|
|
||||||
}
|
}
|
||||||
/* When writing a single-width character over a double-width
|
/* When writing a single-width character over a double-width
|
||||||
* character and at the end of the redrawn text, need to clear out
|
* character and at the end of the redrawn text, need to clear out
|
||||||
@@ -5325,16 +5304,7 @@ void screen_getbytes(int row, int col, char_u *bytes, int *attrp)
|
|||||||
bytes[0] = ScreenLines[off];
|
bytes[0] = ScreenLines[off];
|
||||||
bytes[1] = NUL;
|
bytes[1] = NUL;
|
||||||
|
|
||||||
if (enc_utf8 && ScreenLinesUC[off] != 0)
|
|
||||||
bytes[utfc_char2bytes(off, bytes)] = NUL;
|
bytes[utfc_char2bytes(off, bytes)] = NUL;
|
||||||
else if (enc_dbcs == DBCS_JPNU && ScreenLines[off] == 0x8e) {
|
|
||||||
bytes[0] = ScreenLines[off];
|
|
||||||
bytes[1] = ScreenLines2[off];
|
|
||||||
bytes[2] = NUL;
|
|
||||||
} else if (enc_dbcs && MB_BYTE2LEN(bytes[0]) > 1) {
|
|
||||||
bytes[1] = ScreenLines[off + 1];
|
|
||||||
bytes[2] = NUL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5524,12 +5494,10 @@ void screen_puts_len(char_u *text, int textlen, int row, int col, int attr)
|
|||||||
ScreenLines[off + 1] = ptr[1];
|
ScreenLines[off + 1] = ptr[1];
|
||||||
ScreenAttrs[off + 1] = attr;
|
ScreenAttrs[off + 1] = attr;
|
||||||
screen_char_2(off, row, col);
|
screen_char_2(off, row, col);
|
||||||
} else if (l_enc_dbcs == DBCS_JPNU && c == 0x8e) {
|
} else {
|
||||||
ScreenLines2[off] = ptr[1];
|
|
||||||
screen_char(off, row, col);
|
|
||||||
} else
|
|
||||||
screen_char(off, row, col);
|
screen_char(off, row, col);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (l_has_mbyte) {
|
if (l_has_mbyte) {
|
||||||
off += mbyte_cells;
|
off += mbyte_cells;
|
||||||
col += mbyte_cells;
|
col += mbyte_cells;
|
||||||
@@ -5901,7 +5869,7 @@ static void screen_char(unsigned off, int row, int col)
|
|||||||
ui_cursor_goto(row, col);
|
ui_cursor_goto(row, col);
|
||||||
ui_set_highlight(ScreenAttrs[off]);
|
ui_set_highlight(ScreenAttrs[off]);
|
||||||
|
|
||||||
if (enc_utf8 && ScreenLinesUC[off] != 0) {
|
if (ScreenLinesUC[off] != 0) {
|
||||||
char_u buf[MB_MAXBYTES + 1];
|
char_u buf[MB_MAXBYTES + 1];
|
||||||
|
|
||||||
// Convert UTF-8 character to bytes and write it.
|
// Convert UTF-8 character to bytes and write it.
|
||||||
@@ -5909,10 +5877,6 @@ static void screen_char(unsigned off, int row, int col)
|
|||||||
ui_puts(buf);
|
ui_puts(buf);
|
||||||
} else {
|
} else {
|
||||||
ui_putc(ScreenLines[off]);
|
ui_putc(ScreenLines[off]);
|
||||||
// double-byte character in single-width cell
|
|
||||||
if (enc_dbcs == DBCS_JPNU && ScreenLines[off] == 0x8e) {
|
|
||||||
ui_putc(ScreenLines2[off]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6104,40 +6068,25 @@ int screen_valid(int doclear)
|
|||||||
void screenalloc(bool doclear)
|
void screenalloc(bool doclear)
|
||||||
{
|
{
|
||||||
int new_row, old_row;
|
int new_row, old_row;
|
||||||
int outofmem = FALSE;
|
|
||||||
int len;
|
int len;
|
||||||
schar_T *new_ScreenLines;
|
|
||||||
u8char_T *new_ScreenLinesUC = NULL;
|
|
||||||
u8char_T *new_ScreenLinesC[MAX_MCO];
|
|
||||||
schar_T *new_ScreenLines2 = NULL;
|
|
||||||
int i;
|
|
||||||
sattr_T *new_ScreenAttrs;
|
|
||||||
unsigned *new_LineOffset;
|
|
||||||
char_u *new_LineWraps;
|
|
||||||
StlClickDefinition *new_tab_page_click_defs;
|
|
||||||
static bool entered = false; // avoid recursiveness
|
static bool entered = false; // avoid recursiveness
|
||||||
static bool done_outofmem_msg = false;
|
static bool done_outofmem_msg = false;
|
||||||
int retry_count = 0;
|
int retry_count = 0;
|
||||||
const bool l_enc_utf8 = enc_utf8;
|
|
||||||
const int l_enc_dbcs = enc_dbcs;
|
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
/*
|
// Allocation of the screen buffers is done only when the size changes and
|
||||||
* Allocation of the screen buffers is done only when the size changes and
|
// when Rows and Columns have been set and we have started doing full
|
||||||
* when Rows and Columns have been set and we have started doing full
|
// screen stuff.
|
||||||
* screen stuff.
|
|
||||||
*/
|
|
||||||
if ((ScreenLines != NULL
|
if ((ScreenLines != NULL
|
||||||
&& Rows == screen_Rows
|
&& Rows == screen_Rows
|
||||||
&& Columns == screen_Columns
|
&& Columns == screen_Columns
|
||||||
&& l_enc_utf8 == (ScreenLinesUC != NULL)
|
&& ScreenLinesUC != NULL
|
||||||
&& (l_enc_dbcs == DBCS_JPNU) == (ScreenLines2 != NULL)
|
&& p_mco == Screen_mco)
|
||||||
&& p_mco == Screen_mco
|
|
||||||
)
|
|
||||||
|| Rows == 0
|
|| Rows == 0
|
||||||
|| Columns == 0
|
|| Columns == 0
|
||||||
|| (!full_screen && ScreenLines == NULL))
|
|| (!full_screen && ScreenLines == NULL)) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* It's possible that we produce an out-of-memory message below, which
|
* It's possible that we produce an out-of-memory message below, which
|
||||||
@@ -6175,22 +6124,22 @@ retry:
|
|||||||
if (aucmd_win != NULL)
|
if (aucmd_win != NULL)
|
||||||
win_free_lsize(aucmd_win);
|
win_free_lsize(aucmd_win);
|
||||||
|
|
||||||
new_ScreenLines = xmalloc((size_t)((Rows + 1) * Columns * sizeof(schar_T)));
|
schar_T *new_ScreenLines = xmalloc(
|
||||||
memset(new_ScreenLinesC, 0, sizeof(u8char_T *) * MAX_MCO);
|
(size_t)((Rows + 1) * Columns * sizeof(*new_ScreenLines)));
|
||||||
if (l_enc_utf8) {
|
u8char_T *new_ScreenLinesC[MAX_MCO];
|
||||||
new_ScreenLinesUC = xmalloc(
|
memset(new_ScreenLinesC, 0, sizeof(new_ScreenLinesC));
|
||||||
(size_t)((Rows + 1) * Columns * sizeof(u8char_T)));
|
u8char_T *new_ScreenLinesUC = xmalloc(
|
||||||
for (i = 0; i < p_mco; ++i)
|
(size_t)((Rows + 1) * Columns * sizeof(*new_ScreenLinesUC)));
|
||||||
new_ScreenLinesC[i] = xcalloc((Rows + 1) * Columns, sizeof(u8char_T));
|
for (int i = 0; i < p_mco; i++) {
|
||||||
|
new_ScreenLinesC[i] = xcalloc(
|
||||||
|
(size_t)((Rows + 1) * Columns), sizeof(new_ScreenLinesC[0][0]));
|
||||||
}
|
}
|
||||||
if (l_enc_dbcs == DBCS_JPNU)
|
sattr_T *new_ScreenAttrs = xmalloc(
|
||||||
new_ScreenLines2 = xmalloc(
|
(size_t)((Rows + 1) * Columns * sizeof(*new_ScreenAttrs)));
|
||||||
(size_t)((Rows + 1) * Columns * sizeof(schar_T)));
|
unsigned *new_LineOffset = xmalloc((size_t)(Rows * sizeof(*new_LineOffset)));
|
||||||
new_ScreenAttrs = xmalloc((size_t)((Rows + 1) * Columns * sizeof(sattr_T)));
|
char_u *new_LineWraps = xmalloc((size_t)(Rows * sizeof(*new_LineWraps)));
|
||||||
new_LineOffset = xmalloc((size_t)(Rows * sizeof(unsigned)));
|
StlClickDefinition *new_tab_page_click_defs = xcalloc(
|
||||||
new_LineWraps = xmalloc((size_t)(Rows * sizeof(char_u)));
|
(size_t)Columns, sizeof(*new_tab_page_click_defs));
|
||||||
new_tab_page_click_defs = xcalloc(
|
|
||||||
(size_t) Columns, sizeof(*new_tab_page_click_defs));
|
|
||||||
|
|
||||||
FOR_ALL_TAB_WINDOWS(tp, wp) {
|
FOR_ALL_TAB_WINDOWS(tp, wp) {
|
||||||
win_alloc_lines(wp);
|
win_alloc_lines(wp);
|
||||||
@@ -6199,23 +6148,20 @@ retry:
|
|||||||
win_alloc_lines(aucmd_win);
|
win_alloc_lines(aucmd_win);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < p_mco; ++i)
|
int i;
|
||||||
if (new_ScreenLinesC[i] == NULL)
|
for (i = 0; i < p_mco; i++) {
|
||||||
|
if (new_ScreenLinesC[i] == NULL) {
|
||||||
break;
|
break;
|
||||||
if (new_ScreenLines == NULL
|
}
|
||||||
|| (new_ScreenLinesUC == NULL || i != p_mco)
|
}
|
||||||
|| new_ScreenAttrs == NULL
|
if (i != p_mco) {
|
||||||
|| new_LineOffset == NULL
|
|
||||||
|| new_LineWraps == NULL
|
|
||||||
|| new_tab_page_click_defs == NULL
|
|
||||||
|| outofmem) {
|
|
||||||
if (ScreenLines != NULL || !done_outofmem_msg) {
|
if (ScreenLines != NULL || !done_outofmem_msg) {
|
||||||
/* guess the size */
|
// Guess the size.
|
||||||
do_outofmem_msg((Rows + 1) * Columns);
|
do_outofmem_msg((Rows + 1) * Columns);
|
||||||
|
|
||||||
/* Remember we did this to avoid getting outofmem messages over
|
// Remember we did this to avoid getting outofmem messages over
|
||||||
* and over again. */
|
// and over again.
|
||||||
done_outofmem_msg = TRUE;
|
done_outofmem_msg = true;
|
||||||
}
|
}
|
||||||
xfree(new_ScreenLines);
|
xfree(new_ScreenLines);
|
||||||
new_ScreenLines = NULL;
|
new_ScreenLines = NULL;
|
||||||
@@ -6225,8 +6171,6 @@ retry:
|
|||||||
xfree(new_ScreenLinesC[i]);
|
xfree(new_ScreenLinesC[i]);
|
||||||
new_ScreenLinesC[i] = NULL;
|
new_ScreenLinesC[i] = NULL;
|
||||||
}
|
}
|
||||||
xfree(new_ScreenLines2);
|
|
||||||
new_ScreenLines2 = NULL;
|
|
||||||
xfree(new_ScreenAttrs);
|
xfree(new_ScreenAttrs);
|
||||||
new_ScreenAttrs = NULL;
|
new_ScreenAttrs = NULL;
|
||||||
xfree(new_LineOffset);
|
xfree(new_LineOffset);
|
||||||
@@ -6249,53 +6193,42 @@ retry:
|
|||||||
* executing an external command, for the GUI).
|
* executing an external command, for the GUI).
|
||||||
*/
|
*/
|
||||||
if (!doclear) {
|
if (!doclear) {
|
||||||
(void)memset(new_ScreenLines + new_row * Columns,
|
memset(new_ScreenLines + new_row * Columns,
|
||||||
' ', (size_t)Columns * sizeof(schar_T));
|
' ', (size_t)Columns * sizeof(new_ScreenLines[0]));
|
||||||
if (l_enc_utf8) {
|
memset(new_ScreenLinesUC + new_row * Columns,
|
||||||
(void)memset(new_ScreenLinesUC + new_row * Columns,
|
0, (size_t)Columns * sizeof(new_ScreenLinesUC[0]));
|
||||||
0, (size_t)Columns * sizeof(u8char_T));
|
for (i = 0; i < p_mco; i++) {
|
||||||
for (i = 0; i < p_mco; ++i)
|
memset(new_ScreenLinesC[i] + new_row * Columns,
|
||||||
(void)memset(new_ScreenLinesC[i]
|
0, (size_t)Columns * sizeof(new_ScreenLinesC[0][0]));
|
||||||
+ new_row * Columns,
|
|
||||||
0, (size_t)Columns * sizeof(u8char_T));
|
|
||||||
}
|
}
|
||||||
if (l_enc_dbcs == DBCS_JPNU)
|
memset(new_ScreenAttrs + new_row * Columns,
|
||||||
(void)memset(new_ScreenLines2 + new_row * Columns,
|
0, (size_t)Columns * sizeof(new_ScreenAttrs[0]));
|
||||||
0, (size_t)Columns * sizeof(schar_T));
|
|
||||||
(void)memset(new_ScreenAttrs + new_row * Columns,
|
|
||||||
0, (size_t)Columns * sizeof(sattr_T));
|
|
||||||
old_row = new_row + (screen_Rows - Rows);
|
old_row = new_row + (screen_Rows - Rows);
|
||||||
if (old_row >= 0 && ScreenLines != NULL) {
|
if (old_row >= 0 && ScreenLines != NULL) {
|
||||||
if (screen_Columns < Columns)
|
if (screen_Columns < Columns)
|
||||||
len = screen_Columns;
|
len = screen_Columns;
|
||||||
else
|
else
|
||||||
len = Columns;
|
len = Columns;
|
||||||
/* When switching to utf-8 don't copy characters, they
|
// When switching to utf-8 don't copy characters, they
|
||||||
* may be invalid now. Also when p_mco changes. */
|
// may be invalid now. Also when p_mco changes.
|
||||||
if (!(l_enc_utf8 && ScreenLinesUC == NULL)
|
if (ScreenLinesUC != NULL && p_mco == Screen_mco) {
|
||||||
&& p_mco == Screen_mco)
|
|
||||||
memmove(new_ScreenLines + new_LineOffset[new_row],
|
memmove(new_ScreenLines + new_LineOffset[new_row],
|
||||||
ScreenLines + LineOffset[old_row],
|
ScreenLines + LineOffset[old_row],
|
||||||
(size_t)len * sizeof(schar_T));
|
(size_t)len * sizeof(new_ScreenLines[0]));
|
||||||
if (l_enc_utf8 && ScreenLinesUC != NULL
|
}
|
||||||
&& p_mco == Screen_mco) {
|
if (ScreenLinesUC != NULL && p_mco == Screen_mco) {
|
||||||
memmove(new_ScreenLinesUC + new_LineOffset[new_row],
|
memmove(new_ScreenLinesUC + new_LineOffset[new_row],
|
||||||
ScreenLinesUC + LineOffset[old_row],
|
ScreenLinesUC + LineOffset[old_row],
|
||||||
(size_t)len * sizeof(u8char_T));
|
(size_t)len * sizeof(new_ScreenLinesUC[0]));
|
||||||
for (i = 0; i < p_mco; ++i)
|
for (i = 0; i < p_mco; i++) {
|
||||||
memmove(new_ScreenLinesC[i]
|
memmove(new_ScreenLinesC[i] + new_LineOffset[new_row],
|
||||||
+ new_LineOffset[new_row],
|
|
||||||
ScreenLinesC[i] + LineOffset[old_row],
|
ScreenLinesC[i] + LineOffset[old_row],
|
||||||
(size_t)len * sizeof(u8char_T));
|
(size_t)len * sizeof(new_ScreenLinesC[0][0]));
|
||||||
}
|
}
|
||||||
if (ScreenLines2 != NULL) {
|
|
||||||
memmove(new_ScreenLines2 + new_LineOffset[new_row],
|
|
||||||
ScreenLines2 + LineOffset[old_row],
|
|
||||||
(size_t)len * sizeof(schar_T));
|
|
||||||
}
|
}
|
||||||
memmove(new_ScreenAttrs + new_LineOffset[new_row],
|
memmove(new_ScreenAttrs + new_LineOffset[new_row],
|
||||||
ScreenAttrs + LineOffset[old_row],
|
ScreenAttrs + LineOffset[old_row],
|
||||||
(size_t)len * sizeof(sattr_T));
|
(size_t)len * sizeof(new_ScreenAttrs[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6310,7 +6243,6 @@ retry:
|
|||||||
for (i = 0; i < p_mco; ++i)
|
for (i = 0; i < p_mco; ++i)
|
||||||
ScreenLinesC[i] = new_ScreenLinesC[i];
|
ScreenLinesC[i] = new_ScreenLinesC[i];
|
||||||
Screen_mco = p_mco;
|
Screen_mco = p_mco;
|
||||||
ScreenLines2 = new_ScreenLines2;
|
|
||||||
ScreenAttrs = new_ScreenAttrs;
|
ScreenAttrs = new_ScreenAttrs;
|
||||||
LineOffset = new_LineOffset;
|
LineOffset = new_LineOffset;
|
||||||
LineWraps = new_LineWraps;
|
LineWraps = new_LineWraps;
|
||||||
@@ -6344,12 +6276,10 @@ retry:
|
|||||||
|
|
||||||
void free_screenlines(void)
|
void free_screenlines(void)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
|
|
||||||
xfree(ScreenLinesUC);
|
xfree(ScreenLinesUC);
|
||||||
for (i = 0; i < Screen_mco; ++i)
|
for (int i = 0; i < Screen_mco; i++) {
|
||||||
xfree(ScreenLinesC[i]);
|
xfree(ScreenLinesC[i]);
|
||||||
xfree(ScreenLines2);
|
}
|
||||||
xfree(ScreenLines);
|
xfree(ScreenLines);
|
||||||
xfree(ScreenAttrs);
|
xfree(ScreenAttrs);
|
||||||
xfree(LineOffset);
|
xfree(LineOffset);
|
||||||
@@ -6433,25 +6363,21 @@ static void lineclear(unsigned off, int width)
|
|||||||
*/
|
*/
|
||||||
static void linecopy(int to, int from, win_T *wp)
|
static void linecopy(int to, int from, win_T *wp)
|
||||||
{
|
{
|
||||||
unsigned off_to = LineOffset[to] + wp->w_wincol;
|
const unsigned off_to = LineOffset[to] + wp->w_wincol;
|
||||||
unsigned off_from = LineOffset[from] + wp->w_wincol;
|
const unsigned off_from = LineOffset[from] + wp->w_wincol;
|
||||||
|
|
||||||
memmove(ScreenLines + off_to, ScreenLines + off_from,
|
memmove(ScreenLines + off_to, ScreenLines + off_from,
|
||||||
wp->w_width * sizeof(schar_T));
|
wp->w_width * sizeof(ScreenLines[0]));
|
||||||
if (enc_utf8) {
|
|
||||||
int i;
|
|
||||||
|
|
||||||
memmove(ScreenLinesUC + off_to, ScreenLinesUC + off_from,
|
memmove(ScreenLinesUC + off_to, ScreenLinesUC + off_from,
|
||||||
wp->w_width * sizeof(u8char_T));
|
wp->w_width * sizeof(u8char_T));
|
||||||
for (i = 0; i < p_mco; ++i)
|
for (int i = 0; i < p_mco; i++) {
|
||||||
memmove(ScreenLinesC[i] + off_to, ScreenLinesC[i] + off_from,
|
memmove(ScreenLinesC[i] + off_to, ScreenLinesC[i] + off_from,
|
||||||
wp->w_width * sizeof(u8char_T));
|
wp->w_width * sizeof(ScreenLinesC[0]));
|
||||||
}
|
}
|
||||||
if (enc_dbcs == DBCS_JPNU)
|
|
||||||
memmove(ScreenLines2 + off_to, ScreenLines2 + off_from,
|
|
||||||
wp->w_width * sizeof(schar_T));
|
|
||||||
memmove(ScreenAttrs + off_to, ScreenAttrs + off_from,
|
memmove(ScreenAttrs + off_to, ScreenAttrs + off_from,
|
||||||
wp->w_width * sizeof(sattr_T));
|
wp->w_width * sizeof(ScreenAttrs[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user