diff options
Diffstat (limited to 'src/nvim/search.c')
-rw-r--r-- | src/nvim/search.c | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/src/nvim/search.c b/src/nvim/search.c index d635763acc..5566df74ef 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -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; - } - } - 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; - } + for (p = line + curwin->w_cursor.col; p > line; ) { + if (*p == '<') { // find '<' under/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); |