Skip to content

Commit

Permalink
Pass correct cursor position to Parser#parse() inside the acceptLine …
Browse files Browse the repository at this point in the history
…method, fixes #84
  • Loading branch information
gnodet committed Jan 5, 2017
1 parent 66ce215 commit 6f7a2e5
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2474,12 +2474,11 @@ protected boolean quit() {

protected boolean acceptLine() {
parsedLine = null;
String str = buf.toString();
if (!isSet(Option.DISABLE_EVENT_EXPANSION)) {
try {
String str = buf.toString();
String exp = expander.expandHistory(history, str);
if (!exp.equals(str)) {
str = exp;
buf.clear();
buf.write(exp);
if (isSet(Option.HISTORY_VERIFY)) {
Expand All @@ -2491,7 +2490,7 @@ protected boolean acceptLine() {
}
}
try {
parsedLine = parser.parse(str, str.length(), ParseContext.ACCEPT_LINE);
parsedLine = parser.parse(buf.toString(), buf.cursor(), ParseContext.ACCEPT_LINE);
} catch (EOFError e) {
buf.write("\n");
return true;
Expand Down

0 comments on commit 6f7a2e5

Please sign in to comment.