Skip to content

Commit 44fdc00

Browse files
committed
fix: scroll focused editor only (ignore modal)
1 parent 0d9d851 commit 44fdc00

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

main.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ export default class EditorScrollCommandsPlugin extends Plugin {
4343

4444
scroll(offset: number) {
4545
let editor = this.app.workspace.activeEditor?.editor;
46-
if (!editor) { return; }
46+
if (!editor ||
47+
// @ts-expect-error
48+
!editor.activeCM.dom.hasClass('cm-focused')
49+
) { return; }
4750

4851
if (!this.intervalId) {
4952
this.editorScrolling = this.app.workspace.activeEditor;

manifest.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"id": "editor-scroll-commands",
3-
"name": "Editor Scroll Commands",
4-
"version": "1.1.0",
5-
"minAppVersion": "0.15.0",
6-
"description": "Add scroll commands for editor, so you can assign hotkeys.",
7-
"author": "Andrey Sorokin <[email protected]>",
8-
"isDesktopOnly": true
9-
}
2+
"id": "editor-scroll-commands",
3+
"name": "Editor Scroll Commands",
4+
"version": "1.1.1",
5+
"minAppVersion": "0.15.0",
6+
"description": "Add scroll commands for editor, so you can assign hotkeys.",
7+
"author": "Andrey Sorokin <[email protected]>",
8+
"isDesktopOnly": true
9+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "editor-scroll-commands",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "Add scroll commands for editor, so you can assign hotkeys.",
55
"main": "main.js",
66
"scripts": {

versions.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"1.0.0": "0.15.0",
3-
"1.0.3": "0.15.0",
4-
"1.1.0": "0.15.0"
5-
}
2+
"1.0.0": "0.15.0",
3+
"1.0.3": "0.15.0",
4+
"1.1.0": "0.15.0",
5+
"1.1.1": "0.15.0"
6+
}

0 commit comments

Comments
 (0)