From 3c7ea8d619d77d303e9c51118b22c81a3ffbf550 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 11 Jun 2018 23:43:14 -0400 Subject: vim-patch:8.0.0451: some macros are in lower case Problem: Some macros are in lower case. Solution: Make a few more macros upper case. Avoid lower case macros use an argument twice. https://github.com/vim/vim/commit/91acfffc1e6c0d8c2abfb186a0e79a5bf19c3f3f --- src/nvim/search.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'src/nvim/search.c') diff --git a/src/nvim/search.c b/src/nvim/search.c index cb59eb6d04..6c974850ac 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -3239,35 +3239,41 @@ static int in_html_tag(int end_tag) /* 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)) + 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; + } + 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 */ + if (*p == '<') { // find '<' under/before cursor break; - mb_ptr_back(line, p); - if (*p == '>') /* find '>' before cursor */ + } + MB_PTR_BACK(line, p); + if (*p == '>') { // find '>' before cursor break; + } + } + if (*p != '<') { + return false; } - if (*p != '<') - return FALSE; } pos.lnum = curwin->w_cursor.lnum; pos.col = (colnr_T)(p - line); - mb_ptr_adv(p); - if (end_tag) - /* check that there is a '/' after the '<' */ + MB_PTR_ADV(p); + if (end_tag) { + // check that there is a '/' after the '<' return *p == '/'; + } /* check that there is no '/' after the '<' */ if (*p == '/') @@ -3371,8 +3377,10 @@ again: */ inc_cursor(); p = get_cursor_pos_ptr(); - for (cp = p; *cp != NUL && *cp != '>' && !ascii_iswhite(*cp); mb_ptr_adv(cp)) - ; + for (cp = p; + *cp != NUL && *cp != '>' && !ascii_iswhite(*cp); + MB_PTR_ADV(cp)) { + } len = (int)(cp - p); if (len == 0) { curwin->w_cursor = old_pos; -- cgit