Add dedicated preview feature for East Asian Width (#4097)

This commit is contained in:
Jelle Zijlstra 2023-12-09 21:14:25 -08:00 committed by GitHub
parent 61b529b7d1
commit ce28be2705
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -851,7 +851,7 @@ def is_line_short_enough( # noqa: C901
if not line_str:
line_str = line_to_string(line)
width = str_width if mode.preview else len
width = str_width if Preview.respect_east_asian_width in mode else len
if Preview.multiline_string_handling not in mode:
return (

View File

@ -195,6 +195,7 @@ class Preview(Enum):
single_line_format_skip_with_multiple_comments = auto()
long_case_block_line_splitting = auto()
allow_form_feeds = auto()
respect_east_asian_width = auto()
class Deprecated(UserWarning):