Skip to content
This repository was archived by the owner on Aug 5, 2024. It is now read-only.

Commit 64e708b

Browse files
author
Hamza Ali
committed
fix: Update to changes requested by lishid.
1 parent 5f142a0 commit 64e708b

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

main.ts

+6-8
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,16 @@ declare const CodeMirror: any;
55
export default class ImprovedVimCursor extends Plugin {
66
async onload() {
77
this.setup()
8+
}
89

9-
this.registerEvent(this.app.workspace.on('file-open', () => {
10-
this.setup();
11-
}));
10+
async onunload() {
11+
CodeMirror.Vim.defineEx("g0", false, undefined);
12+
CodeMirror.Vim.defineEx("gDollar", false, undefined);
13+
CodeMirror.Vim.defineEx("pHead", false, undefined);
14+
CodeMirror.Vim.defineEx("nHead", false, undefined);
1215
}
1316

1417
setup() {
15-
let view = this.app.workspace.getActiveViewOfType(MarkdownView)
16-
if(!view) {
17-
return
18-
}
19-
2018
CodeMirror.Vim.defineEx("g0", false, (cm: CodeMirror.Editor) => {
2119
cm.execCommand("goLineLeftSmart");
2220
})

0 commit comments

Comments
 (0)