From: Vadim Nikolaev Date: Thu, 28 Apr 2022 15:17:23 +0000 (+0500) Subject: Fix strtobool function (#3025) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/c6800e0c659eba5b22190bf6ae0ba563a4170661?ds=inline Fix strtobool function (#3025) * Fix strtobool function for vim plugin * Update CHANGES.md Co-authored-by: Cooper Lees --- diff --git a/CHANGES.md b/CHANGES.md index 566077b..4cea7fc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -62,6 +62,10 @@ +### Vim Plugin + +- Fixed strtobool function. It didn't parse true/on/false/off. (#3025) + ## 22.3.0 ### Preview style diff --git a/autoload/black.vim b/autoload/black.vim index 66c5b9c..6c381b4 100644 --- a/autoload/black.vim +++ b/autoload/black.vim @@ -5,9 +5,9 @@ import sys import vim def strtobool(text): - if text.lower() in ['y', 'yes', 't', 'true' 'on', '1']: + if text.lower() in ['y', 'yes', 't', 'true', 'on', '1']: return True - if text.lower() in ['n', 'no', 'f', 'false' 'off', '0']: + if text.lower() in ['n', 'no', 'f', 'false', 'off', '0']: return False raise ValueError(f"{text} is not convertable to boolean")