Skip to content

Commit

Permalink
Add dedicated preview feature for East Asian Width (#4097)
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed Dec 10, 2023
1 parent 61b529b commit ce28be2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/black/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
1 change: 1 addition & 0 deletions src/black/mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit ce28be2

Please sign in to comment.