From: Richard Si <63936253+ichard26@users.noreply.github.com> Date: Mon, 31 Aug 2020 21:20:05 +0000 (-0400) Subject: Fix incorrect space before colon in if/while stmts (#1655) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/1d2d7264ec7c448744b771910cc972da03b1cb80?hp=1d2d7264ec7c448744b771910cc972da03b1cb80 Fix incorrect space before colon in if/while stmts (#1655) * Fix incorrect space before colon in if/while stmts Previously Black would format this code ``` if (foo := True): print(foo) ``` as ``` if (foo := True) : print(foo) ``` adding an incorrect space after the RPAR. Buggy code in the normalize_invisible_parens function caused the colon to be wrapped in invisible parentheses. The LPAR of that pair was then prefixed with a single space at the request of the whitespace function. This commit fixes the accidental skipping of a pre-condition check which must return True before parenthesis normalization of a specific child Leaf or Node can happen. The pre-condition check being skipped was why the colon was wrapped in invisible parentheses. * Add an entry in CHANGES.md ---