Obsidian-Code-Styler
Obsidian-Code-Styler copied to clipboard
Bug: Parsing of line number margin width is not precise in editing mode
Describe the bug
Steps to reproduce
Set a large line number offset parameter using ln:
```python ln:1000
code here
```
Expected behaviour
The line number gutter margins should all be exactly the same width.
Current behaviour
The line number gutter margins can differ (delimiter lines and lines with less characters than the last line).
Environment
- Plugin Version: 1.0.0
- Obsidian Version: 1.3.5
- Platform: Desktop
- OS: macOS
Screenshots
Additional context
Due to delay in reading accurate information from DOM in codemirror, the current implementation is the most efficient approach. See here.
Hopefully I can improve the current implementation of this.
See this
This issue is stale because it has been open 60 days with no activity.
This has been improved significantly but it's not perfect. I'll leave this issue open as it could potentially be better still.
i.e. Consistent spacing for different number of digits line numbers (the gap between the gutter and code is different for 2 vs 3 vs 4 digits etc.).