Skip to content

Commit

Permalink
style(plugin-inquirer): update input code format
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhengqbbb committed Jun 2, 2022
1 parent eb372a8 commit 9e95ee5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/@cz-git/plugin-inquirer/src/input/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class CompleteInput extends Base {
this.screen.render(message, bottomContent);
}

filterInput(input?: string) {
filterInput(input: string = this.rl.line) {
if (!input) {
return this.completeValue || "";
}
Expand All @@ -109,9 +109,6 @@ export class CompleteInput extends Base {
this.render(isValid);
}

/**
* @description: Search <any key>
*/
onKeypress(e: { key: { name?: string; ctrl?: boolean }; value: string }) {
if (!this.state && (e.key.name === "tab" || e.key.name === "right")) {
// NOTE: the ansi cursor not work
Expand All @@ -123,6 +120,7 @@ export class CompleteInput extends Base {
this.rl.cursor = this.completeValue?.length;
}
this.state = "touched";
this.completeValue = "";

this.render();
}
Expand Down

0 comments on commit 9e95ee5

Please sign in to comment.