Description
Performing an undo action (Ctrl+Z) while editing a code block in Split View results in document corruption. While the UI panels remain visually synchronized, the undo operation appears to use incorrect positional offsets. This leads to the editor deleting or replacing the wrong range of text across both views.
Environment
- OS: Windows 11
- Ferrite version: v0.3.0
- Installation method: pre-built binary
Steps to Reproduce
- Create a new Markdown file.
- Insert a Code Block containing placeholder text.
- Open Split View.
- In the right-hand panel, click Edit on the code block and append additional text.
- Press Ctrl + Z to undo the change.
Expected Behavior
The undo action should target the specific character offsets of the recent edit, reverting the text cleanly in both panels.
Actual Behavior
The document content becomes corrupted. Although both panels remain synchronized with each other, the "undo" operation applies to the wrong position in the buffer, mangling the Markdown structure or deleting unintended text.
Additional Context
Suspected Cause
The issue is likely not a synchronization failure between panels, but a state-tracking error. The editor likely fails to translate the local offsets of the Split View editor back to the global offsets of the primary Markdown buffer during an undo event.
Description
Performing an undo action (Ctrl+Z) while editing a code block in Split View results in document corruption. While the UI panels remain visually synchronized, the undo operation appears to use incorrect positional offsets. This leads to the editor deleting or replacing the wrong range of text across both views.
Environment
Steps to Reproduce
Expected Behavior
The undo action should target the specific character offsets of the recent edit, reverting the text cleanly in both panels.
Actual Behavior
The document content becomes corrupted. Although both panels remain synchronized with each other, the "undo" operation applies to the wrong position in the buffer, mangling the Markdown structure or deleting unintended text.
Additional Context
Suspected Cause
The issue is likely not a synchronization failure between panels, but a state-tracking error. The editor likely fails to translate the local offsets of the Split View editor back to the global offsets of the primary Markdown buffer during an undo event.