Skip to content

Commit d116565

Browse files
committed
fix: only split when in editing mode
1 parent 37d5332 commit d116565

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ Note splitter is an [Obsidian.md](https://obsidian.md) plugin for desktop only.
2424
## Usage
2525

2626
1. Open a note that you want to split
27-
2. Open the Obsidian command palette
28-
3. Type **Split by delimiter**
29-
4. Press enter
30-
5. Your note is now split
27+
2. Switch to editing mode
28+
3. Open the Obsidian command palette
29+
4. Type **Split by delimiter**
30+
5. Press enter
31+
6. Your note is now split
3132

3233
>[!NOTE]
3334
> Splitting a note will not modify the original note, unless the [delete original](#delete-original) setting is enabled. It will create new notes in an output folder that you specify.

src/main.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ export default class NoteSplitterPlugin extends Plugin {
4040
return;
4141
}
4242

43+
if (view.getMode() !== 'source') {
44+
new Notice("Please switch to editing mode to split the note.");
45+
return;
46+
}
47+
4348
this.splitNoteByDelimiter(file);
4449
},
4550
});

0 commit comments

Comments
 (0)