jbonofre commented on code in PR #1716:
URL: https://github.com/apache/karaf/pull/1716#discussion_r1270231790
##########
shell/core/src/main/java/org/apache/karaf/shell/support/table/Col.java:
##########
@@ -148,8 +149,14 @@ String format(Object cellData) {
if (fullContent.length() == 0) {
return "";
}
- String finalContent = cut(fullContent,
getClippedSize(fullContent.length()));
- updateSize(finalContent.length());
+ if (wrap && size < fullContent.length()) {
+ // make sure splitLines will have an estimate cell size if wrap is
true
+ updateSize(fullContent.length());
+ }
+ List<String> lines = splitLines(fullContent);
+ int maxLineSize =
lines.stream().mapToInt(String::length).max().getAsInt(); // at least one line
exists due to test above
+ updateSize(maxLineSize); // calls getClippedSize()
+ String finalContent = lines.stream().map(line -> cut(line,
getClippedSize(line.length()))).collect(Collectors.joining("\n"));
Review Comment:
I would address the split line separator in another PR. Anyway I don't think
it's a big deal :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]