Skip to content

Commit

Permalink
fix: Wouldn't get IM when swith from visual mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ALONELUR committed Apr 16, 2022
1 parent 79e2b6c commit 335b8c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const DEFAULT_SETTINGS: VimImPluginSettings = {
export default class VimImPlugin extends Plugin {
settings: VimImPluginSettings;
private currentInsertIM = '';
private previousMode = '';
private isWinPlatform = false;

private initialized = false;
Expand All @@ -70,6 +71,8 @@ export default class VimImPlugin extends Plugin {
});
}
}

this.previousMode = "normal";
});


Expand Down Expand Up @@ -146,6 +149,9 @@ export default class VimImPlugin extends Plugin {

break;
default:
if (this.previousMode != "insert") {
break;
}
console.log("change to noInsert");
//[0]: Obtian im in Insert Mode
if (typeof obtainc != 'undefined' && obtainc) {
Expand All @@ -171,7 +177,7 @@ export default class VimImPlugin extends Plugin {

break;
}
// this.vimStatusBar.setText(this.currentVimStatus);
this.previousMode = modeObj.mode;
}

onunload() {
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "vim-im-select",
"name": "Vim IM Select",
"version": "0.1.1",
"version": "0.1.2",
"minAppVersion": "0.12.0",
"description": "Support auto select the apposite input method in different vim mode",
"author": "Alonelur",
Expand Down

0 comments on commit 335b8c9

Please sign in to comment.