Obsidian-Code-Styler
Obsidian-Code-Styler copied to clipboard
Bug: Editing Mode Folded Codeblock Issues
Describe the bug
Folded codeblocks in editing mode have a number of issues including:
- [ ] Selecting and replacing (drag across codeblock and type) causes the fold region to disappear (unless you cursor into it)
- [ ] Typing or deleting
foldparameter does not automatically update folding.
Completed:
- [x] When changing from Live Preview to Source Mode, the folded codeblocks disappear
- [x] Excluding or ignoring codeblocks which are folded makes the folded codeblock disappear
- [x] Temporary unfold should be applied if either end of any selection is inside the region, not just both ends
Steps to reproduce
Described above
Environment
- Plugin Version: 1.0.4
- Obsidian Version: 1.3.7
- Platform: Desktop
- OS: macOS
Screenshots
Additional context
See #30
The second bullet point has been addressed.
To deal with empty folding regions, filter values which start and end at the same position.
To deal with selection and destruction, need to find ranges that change with each transaction and filter those.