Skip to content

Commit

Permalink
fix(mode): allow escaping from replace mode (#1305)
Browse files Browse the repository at this point in the history
Closes #1304
  • Loading branch information
penelopeysm committed Jul 12, 2023
1 parent 2b27081 commit 76d473c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mode_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ export class Mode {
return this.shortname.charAt(0).replace("\x16", "v");
}
// mode long name
public get name(): "insert" | "visual" | "cmdline" | "normal" {
public get name(): "insert" | "visual" | "cmdline" | "replace" | "normal" {
switch (this.char.toLowerCase()) {
case "i":
return "insert";
case "v":
return "visual";
case "c":
return "cmdline";
case "r":
return "replace";
case "n":
default:
return "normal";
Expand Down Expand Up @@ -105,6 +107,7 @@ export class ModeManager implements Disposable, NeovimExtensionRequestProcessabl
commands.executeCommand("setContext", "neovim.recording", false);
}
commands.executeCommand("setContext", "neovim.mode", this.mode.name);
this.logger.debug(`${LOG_PREFIX}: Setting mode context to ${this.mode.name}`);
this.eventEmitter.emit("neovimModeChanged");
break;
}
Expand Down

0 comments on commit 76d473c

Please sign in to comment.