From: Yilei "Dolee" Yang Date: Sat, 10 Dec 2022 15:58:45 +0000 (-0800) Subject: Fix a crash in preview style with assert + parenthesized string. (#3415) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/96e62c57e3023977de177a8ba34678007a63f1fe?hp=96e62c57e3023977de177a8ba34678007a63f1fe Fix a crash in preview style with assert + parenthesized string. (#3415) The bug is in the `get_leaves_inside_matching_brackets` on the third line below: ```python assert xxxxxxxxx.xxxxxxxxx.xxxxxxxxx( xxxxxxxxx ).xxxxxxxxxxxxxxxxxx(), ( "xxx {xxxxxxxxx} xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ) ``` Including the invisible paren, third line is `).xxxxxxxxxxxxxxxxxx()), (`, that it has a matched pair then an unmatched closing paren afterwards. This PR ensures the returned leaves are actually matched. Fixes #3414. ---