-
-
Notifications
You must be signed in to change notification settings - Fork 438
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Obsidian fails to delete all text in a git-tracked note when Hunk Signs are enabled, if the note was empty when last committed to git.
Relevant errors (if available) from notifications or console (CTRL+SHIFT+I)
app.js:1 RangeError: Invalid position 4 in document of length 0
at e.lineAt (app.js:1:254574)
at Fh (plugin:obsidian-git:220:243)
at y0 (plugin:obsidian-git:218:491)
at Pz (plugin:obsidian-git:220:98)
at pF (plugin:obsidian-git:220:179)
at gF (plugin:obsidian-git:227:1462)
at Rz (plugin:obsidian-git:227:1759)
at e.update [as updateF] (plugin:obsidian-git:227:469)
at Object.update (app.js:1:279802)
at e.computeSlot (app.js:1:290652)Steps to reproduce
- Enable the new Hunk Signs feature
- Open a git-tracked empty note (which was an empty note when last committed to the git repo)
- Add some text to the empty note, e.g. type in "test", and observe the green hunk sign appear
- Try to delete all text in the note (e.g. select all with
Cmd + Athen hitBackspace) - Close the note then reopen it, and observe that the text was not actually deleted
Expected Behavior
It's possible to delete all content in the note
Addition context
Screen.Recording.2026-01-21.at.10.20.41.AM.mov
^ Side note: some other logs from the obsidian-git plugin are extremely frequent and clutter up the dev tools console, and could be worth removing. But that's a much smaller issue obviously
Also I mentioned this in the Discord, but I'll say it again here, the Hunk Signs feature is awesome, massively appreciate it!! This bug is the only significant issue I've faced with it so far, and does lead me to frequently toggle Hunk Signs on and off to work around it.
Operating system
macOS
Installation Method
None
Plugin version
2.36.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working