Skip to content

Commit

Permalink
replaced tabs with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn committed Dec 4, 2018
1 parent d5e2dbc commit 4244c6a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions reader/src/main/java/org/jline/reader/impl/DefaultParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ public ParsedLine parse(final String line, final int cursor, ParseContext contex
// Start a quote block
quoteStart = i;
if (current.length()==0) {
quotedWord = true;
quotedWord = true;
} else {
current.append(line.charAt(i));
current.append(line.charAt(i));
}
} else if (quoteStart >= 0 && line.charAt(quoteStart) == line.charAt(i) && !isEscaped(line, i)) {
// End quote block
if (!quotedWord) {
current.append(line.charAt(i));
current.append(line.charAt(i));
} else if (rawWordCursor >= 0 && rawWordLength < 0) {
rawWordLength = i - rawWordStart + 1;
}
Expand Down Expand Up @@ -390,10 +390,10 @@ public CharSequence escape(CharSequence candidate, boolean complete) {
}
} else if (openingQuote == null) {
for (int i = 0; i < sb.length(); i++) {
if (isQuoteChar(sb, i)) {
quote = null;
if (isQuoteChar(sb, i)) {
quote = null;
break;
}
}
if (isDelimiterChar(sb, i)) {
quote = "'";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ public void escapeChars() throws Exception {

@Test
public void middleQuotesEscapeCharsNull() throws Exception {
DefaultParser dp = (DefaultParser) reader.getParser();
dp.setEscapeChars(null);
reader.setVariable(LineReader.ERRORS, 0);
reader.setParser(dp);
DefaultParser dp = (DefaultParser) reader.getParser();
dp.setEscapeChars(null);
reader.setVariable(LineReader.ERRORS, 0);
reader.setParser(dp);
reader.setCompleter(new StringsCompleter("/foo?name='foo bar'","/foo?name='foo qux'"));

assertBuffer("/foo?name='foo ", new TestBuffer("/f").tab());
Expand All @@ -75,10 +75,10 @@ public void middleQuotesEscapeCharsNull() throws Exception {

@Test
public void middleQuotesEscapeChars() throws Exception {
DefaultParser dp = (DefaultParser) reader.getParser();
DefaultParser dp = (DefaultParser) reader.getParser();
dp.setEscapeChars(new char[] { '\\' });
reader.setVariable(LineReader.ERRORS, 0);
reader.setParser(dp);
reader.setVariable(LineReader.ERRORS, 0);
reader.setParser(dp);
reader.setCompleter(new StringsCompleter("/foo?name='foo bar'","/foo?name='foo qux'"));

assertBuffer("/foo?name=\\'foo\\ ", new TestBuffer("/f").tab());
Expand Down

0 comments on commit 4244c6a

Please sign in to comment.