Skip to content

Commit ce28be2

Browse files
Add dedicated preview feature for East Asian Width (#4097)
1 parent 61b529b commit ce28be2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/black/lines.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ def is_line_short_enough( # noqa: C901
851851
if not line_str:
852852
line_str = line_to_string(line)
853853

854-
width = str_width if mode.preview else len
854+
width = str_width if Preview.respect_east_asian_width in mode else len
855855

856856
if Preview.multiline_string_handling not in mode:
857857
return (

src/black/mode.py

+1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ class Preview(Enum):
195195
single_line_format_skip_with_multiple_comments = auto()
196196
long_case_block_line_splitting = auto()
197197
allow_form_feeds = auto()
198+
respect_east_asian_width = auto()
198199

199200

200201
class Deprecated(UserWarning):

0 commit comments

Comments
 (0)