Obsidian-Code-Styler icon indicating copy to clipboard operation
Obsidian-Code-Styler copied to clipboard

Bug: Parsing of line number margin width is not precise in editing mode

Open mayurankv opened this issue 2 years ago • 5 comments

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.

mayurankv avatar Jul 08 '23 16:07 mayurankv

Hopefully I can improve the current implementation of this.

mayurankv avatar Jul 08 '23 16:07 mayurankv

See this

mayurankv avatar Jul 10 '23 23:07 mayurankv

This issue is stale because it has been open 60 days with no activity.

github-actions[bot] avatar Dec 25 '23 02:12 github-actions[bot]

This has been improved significantly but it's not perfect. I'll leave this issue open as it could potentially be better still.

mayurankv avatar Feb 12 '24 22:02 mayurankv

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.).

mayurankv avatar Feb 12 '24 22:02 mayurankv