diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-05-01 17:30:38 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-05-01 17:30:38 -0400 |
commit | d542de4a76dd9e600ebcf1405efdc9d3090ad9a8 (patch) | |
tree | 60b1d2aad6205c74b7c2611fbbed45759a302f4f /src/nvim/regexp.c | |
parent | 91afb30b667bbc321d351708f694d00b256be585 (diff) | |
parent | cf4e1fb0f4962319eee292248d9c1f73be3a8d0c (diff) | |
download | rneovim-d542de4a76dd9e600ebcf1405efdc9d3090ad9a8.tar.gz rneovim-d542de4a76dd9e600ebcf1405efdc9d3090ad9a8.tar.bz2 rneovim-d542de4a76dd9e600ebcf1405efdc9d3090ad9a8.zip |
Merge pull request #4688 from ZyX-I/clint-checks
Add check for boolean operators placement
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r-- | src/nvim/regexp.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 608aa38466..886a48e7c5 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -3445,13 +3445,14 @@ static long bt_regexec_both(char_u *line, c = regline[col]; if (prog->regstart == NUL || prog->regstart == c - || (ireg_ic && (( - (enc_utf8 && utf_fold(prog->regstart) == utf_fold(c))) - || (c < 255 && prog->regstart < 255 && - vim_tolower(prog->regstart) == vim_tolower(c))))) + || (ireg_ic + && (((enc_utf8 && utf_fold(prog->regstart) == utf_fold(c))) + || (c < 255 && prog->regstart < 255 + && vim_tolower(prog->regstart) == vim_tolower(c))))) { retval = regtry(prog, col); - else + } else { retval = 0; + } } else { int tm_count = 0; /* Messy cases: unanchored match. */ @@ -4121,15 +4122,15 @@ regmatch ( char_u *opnd; opnd = OPERAND(scan); - /* Inline the first byte, for speed. */ + // Inline the first byte, for speed. if (*opnd != *reginput - && (!ireg_ic || ( - !enc_utf8 && - vim_tolower(*opnd) != vim_tolower(*reginput)))) + && (!ireg_ic + || (!enc_utf8 + && vim_tolower(*opnd) != vim_tolower(*reginput)))) { status = RA_NOMATCH; - else if (*opnd == NUL) { - /* match empty string always works; happens when "~" is - * empty. */ + } else if (*opnd == NUL) { + // match empty string always works; happens when "~" is + // empty. } else { if (opnd[1] == NUL && !(enc_utf8 && ireg_ic)) { len = 1; /* matched a single byte above */ |