Skip to content

Commit d8c8e93

Browse files
committed
feat: show gutter marker next to line under pointer
1 parent 16a75df commit d8c8e93

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/main.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { type Extension } from "@codemirror/state";
12
import {
23
MarkdownView,
34
Notice,
@@ -69,6 +70,7 @@ import { createGetTasksApi } from "./tasks-plugin";
6970
import type { ObsidianContext, OnUpdateFn, PointerDateTime } from "./types";
7071
import { askForConfirmation } from "./ui/confirmation-modal";
7172
import { createEditorMenuCallback } from "./ui/editor-menu";
73+
import { hoverPlugin } from "./ui/gutter-plugin";
7274
import { useDateRanges } from "./ui/hooks/use-date-ranges";
7375
import { useDebounceWithDelay } from "./ui/hooks/use-debounce-with-delay";
7476
import { mountStatusBarWidget } from "./ui/hooks/use-status-bar-widget";
@@ -94,6 +96,7 @@ export default class DayPlanner extends Plugin {
9496
private sTaskEditor!: STaskEditor;
9597
private vaultFacade!: VaultFacade;
9698
private transactionWriter!: TransactionWriter;
99+
private extensions: Extension[] = [];
97100

98101
async onload() {
99102
const initialPluginData: PluginData = {
@@ -183,6 +186,13 @@ export default class DayPlanner extends Plugin {
183186

184187
await this.handleNewPluginVersion();
185188
await this.initTimelineLeafSilently();
189+
190+
this.registerEditorExtension([
191+
hoverPlugin({
192+
onpointerup: () => {},
193+
markerPredicate: () => true,
194+
}),
195+
]);
186196
}
187197

188198
async onunload() {

vite.config.mts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,18 @@ export default defineConfig((env) => ({
7373
return assetInfo.name;
7474
},
7575
},
76-
external: ["obsidian", "electron"],
76+
external: [
77+
"obsidian",
78+
"electron",
79+
"@codemirror/autocomplete",
80+
"@codemirror/collab",
81+
"@codemirror/commands",
82+
"@codemirror/language",
83+
"@codemirror/lint",
84+
"@codemirror/search",
85+
"@codemirror/state",
86+
"@codemirror/view",
87+
],
7788
},
7889
},
7990
test: {

0 commit comments

Comments
 (0)