Skip to content

Commit

Permalink
[#21] added configuration to switch off counting double-width Asian c…
Browse files Browse the repository at this point in the history
…haracters as two characters for line-breaking purposes.

Closes #21
  • Loading branch information
remkop committed Apr 13, 2019
1 parent bd13fae commit e55f62f
Show file tree
Hide file tree
Showing 5 changed files with 176 additions and 28 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ If those characters are treated to have the same width as other characters, the

From this release, picocli will use 2 columns for these wide characters when calculating where to put line breaks, resulting in better usage help message text.

This can be switched off with `CommandLine.setAdjustLineBreaksForWideCJKCharacters(false)`.

## <a name="4.0.0-alpha-2-fixes"></a> Fixed issues
- [#495] Publish picocli as a JPMS module in a new artifact `picocli-core-module`. Thanks to [Warkdev](https://github.com/Warkdev) for the pull request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public String render(Help help) {
TextTable textTable = TextTable.forColumns(help.ansi(),
new Column(15, 2, Overflow.SPAN),
new Column(spec.usageMessage().width() - 15, 2, Overflow.WRAP));
textTable.setAdjustLineBreaksForWideCJKCharacters(spec.usageMessage().adjustLineBreaksForWideCJKCharacters());

for (CommandLine subcommand : spec.subcommands().values()) {
addHierarchy(subcommand, textTable, "");
Expand Down
Loading

0 comments on commit e55f62f

Please sign in to comment.