Anchoring
The quote is the anchor. A comment attaches by searching the note body for the exact text it was written on.
Found → the comment attaches there. Not found → the comment is detached: listed in the sidebar, flagged, decorating nothing. The search is exact. Edit or delete the text a comment was written on and the sidebar flags it, rather than moving the highlight to whichever passage looks closest.
Restoring the text
Section titled “Restoring the text”Nothing about where a comment sits is written to disk, so a comment that detached when you deleted its passage attaches again the moment the text returns. An undo is enough.
A resolved comment is never flagged as detached. It usually detaches because its suggestion was applied, or because the passage was rewritten in answer to it. It keeps its card and its quote, without the dashed border or the alert, and stays at the bottom of the list.
Edits elsewhere in the note
Section titled “Edits elsewhere in the note”A comment is found by its quote. The position recorded beside it orders the sidebar and breaks a tie when the same quote appears twice, and nothing keeps it current. An edit anywhere else in the note leaves every comment attached, whether you make it in Obsidian, in another editor, on another device, or through a git merge.
While you type
Section titled “While you type”Highlights keep up with you as you type around them, and the list settles a moment after you stop. A comment whose quoted text you have just typed over grays out then, rather than flickering while you are still working on the sentence.
Identical passages
Section titled “Identical passages”Anchoring by quoted text cannot distinguish two identical passages. The stored position picks the nearer one, which is right while the anchored copy still exists. Edit the anchored copy itself and its text is gone, so the comment attaches to the surviving twin rather than detaching.
That is rare for a whole sentence and plausible for a two-word quote.