X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/9ce75726fcf1f3a2617e873d925384fd6b876dcb..1e8217fd6284bdb020e7ca70964d677a3016f914:/src/black/trans.py diff --git a/src/black/trans.py b/src/black/trans.py index b08a6d2..25d35af 100644 --- a/src/black/trans.py +++ b/src/black/trans.py @@ -1359,9 +1359,14 @@ class StringSplitter(BaseStringSplitter, CustomSplitMapMixin): # prefix, and the current custom split did NOT originally use a # prefix... if ( - next_value != self._normalize_f_string(next_value, prefix) - and use_custom_breakpoints + use_custom_breakpoints and not csplit.has_prefix + and ( + # `next_value == prefix + QUOTE` happens when the custom + # split is an empty string. + next_value == prefix + QUOTE + or next_value != self._normalize_f_string(next_value, prefix) + ) ): # Then `csplit.break_idx` will be off by one after removing # the 'f' prefix.