diff --git a/src/main/java/org/openrewrite/LanguageComposition.java b/src/main/java/org/openrewrite/LanguageComposition.java index 2c5b585..7d8d983 100644 --- a/src/main/java/org/openrewrite/LanguageComposition.java +++ b/src/main/java/org/openrewrite/LanguageComposition.java @@ -392,6 +392,12 @@ public PrintOutputCapture append(@Nullable String text) { count++; } } + if(!text.isEmpty()) { + char last = text.charAt(text.length() - 1); + if (last != '\n' && last != '\r') { + count++; + } + } return this; }