cleanup: remove legacy enc_dbcs global #9660

This commit is contained in:
Justin M. Keyes
2019-03-02 02:33:36 +01:00
committed by GitHub
parent 708176aea1
commit ed4132d7e9
8 changed files with 27 additions and 71 deletions

View File

@@ -3229,37 +3229,18 @@ static int in_html_tag(int end_tag)
int lc = NUL;
pos_T pos;
if (enc_dbcs) {
char_u *lp = NULL;
/* We search forward until the cursor, because searching backwards is
* very slow for DBCS encodings. */
for (p = line; p < line + curwin->w_cursor.col; MB_PTR_ADV(p)) {
if (*p == '>' || *p == '<') {
lc = *p;
lp = p;
}
for (p = line + curwin->w_cursor.col; p > line; ) {
if (*p == '<') { // find '<' under/before cursor
break;
}
if (*p != '<') { // check for '<' under cursor
if (lc != '<') {
return false;
}
p = lp;
}
} else {
for (p = line + curwin->w_cursor.col; p > line; ) {
if (*p == '<') { // find '<' under/before cursor
break;
}
MB_PTR_BACK(line, p);
if (*p == '>') { // find '>' before cursor
break;
}
}
if (*p != '<') {
return false;
MB_PTR_BACK(line, p);
if (*p == '>') { // find '>' before cursor
break;
}
}
if (*p != '<') {
return false;
}
pos.lnum = curwin->w_cursor.lnum;
pos.col = (colnr_T)(p - line);