Skip to content

Commit

Permalink
Secondary prompt: fix padding when primary prompt has line breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn committed Nov 28, 2020
1 parent a47ccc8 commit a228123
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4189,6 +4189,9 @@ private AttributedString insertSecondaryPrompts(AttributedString strAtt, List<At
List<String> missings = new ArrayList<>();
if (computePrompts && secondaryPromptPattern.contains("%P")) {
width = prompt.columnLength();
if (width > size.getColumns() || prompt.contains('\n')) {
width = new TerminalLine(prompt.toString(), 0, size.getColumns()).getEndLine().length();
}
for (int line = 0; line < lines.size() - 1; line++) {
AttributedString prompt;
buf.append(lines.get(line)).append("\n");
Expand Down

0 comments on commit a228123

Please sign in to comment.