Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! readline: allow completer to rewrite existing input
  • Loading branch information
addaleax authored Jun 28, 2021
commit e69cd1da8f0c30788589d8b430138e8f705c3986
8 changes: 6 additions & 2 deletions lib/readline.js
Original file line number Diff line number Diff line change
Expand Up @@ -709,9 +709,13 @@ Interface.prototype._tabComplete = function(lastKeypressWasTab) {
this._insertString(StringPrototypeSlice(prefix, completeOn.length));
return;
} else if (!completeOn.startsWith(prefix)) {
Comment thread
addaleax marked this conversation as resolved.
Outdated
this.line = StringPrototypeSlice(this.line, 0, this.cursor - completeOn.length) +
this.line = StringPrototypeSlice(this.line,
0,
this.cursor - completeOn.length) +
prefix +
StringPrototypeSlice(this.line, this.cursor, this.line.length);
StringPrototypeSlice(this.line,
this.cursor,
this.line.length);
this.cursor = this.cursor - completeOn.length + prefix.length;
this._refreshLine();
return;
Expand Down