Skip to content

Commit

Permalink
Insert closing bracket only when we have two unclosed brackets, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn committed Nov 6, 2019
1 parent dd8098b commit 92c598b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions reader/src/main/java/org/jline/reader/impl/DefaultParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public ParsedLine parse(final String line, final int cursor, ParseContext contex
if (bracketChecker.isClosingBracketMissing() || bracketChecker.isOpeningBracketMissing()) {
String message = null;
String missing = null;
if(bracketChecker.isClosingBracketMissing()) {
if (bracketChecker.isClosingBracketMissing()) {
message = "Missing closing brackets";
missing = "add: " + bracketChecker.getMissingClosingBrackets();
} else {
Expand Down Expand Up @@ -418,7 +418,7 @@ public int getOpenBrackets() {
}

public String getNextClosingBracket() {
return nested.size() > 1 ? nextClosingBracket : null;
return nested.size() == 2 ? nextClosingBracket : null;
}

private int bracketId(final char[] brackets, final CharSequence buffer, final int pos) {
Expand Down

0 comments on commit 92c598b

Please sign in to comment.