1
0
forked from aniani/vim

patch 9.0.1529: code style test doesn't check for space after "if"

Problem:    Code style test doesn't check for space after "if".
Solution:   Add a test for space.
This commit is contained in:
Bram Moolenaar 2023-05-09 15:00:00 +01:00
parent dda01c05c2
commit c9471b1872
9 changed files with 17 additions and 11 deletions

View File

@ -6863,7 +6863,7 @@ write_chars(
vim_free(unicodebuf);
unicodebuf = length ? LALLOC_MULT(WCHAR, length) : NULL;
unibuflen = unibuflen ? 0 : length;
} while(1);
} while (TRUE);
cells = mb_string2cells(pchBuf, cbToWrite);
}
else // cbToWrite == 1 && *pchBuf == ' ' && enc_utf8

View File

@ -36,6 +36,10 @@ def Test_source_files()
cursor(1, 1)
lnum = search('else\s*{', '', 0, 0, skip)
assert_equal(0, lnum, fname .. ': curly after "else"')
cursor(1, 1)
lnum = search('\<\(if\|while\|for\)(', '', 0, 0, skip)
assert_equal(0, lnum, fname .. ': missing white space after "if"/"while"/"for"')
endfor
bwipe!

View File

@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1529,
/**/
1528,
/**/