Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mayurankv opened this issue Jul 8, 2023 · 5 comments
Assignees
Labels
bug Something isn't working editing mode Relevant to Obsidian editing mode upstream Upstream issue

Comments

@mayurankv
Copy link
Owner

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 mayurankv added the bug Something isn't working label Jul 8, 2023
@mayurankv mayurankv self-assigned this Jul 8, 2023
@mayurankv
Copy link
Owner Author

Hopefully I can improve the current implementation of this.

@mayurankv
Copy link
Owner Author

See this

@github-actions github-actions bot added the Stale label Sep 9, 2023
@mayurankv mayurankv removed the Stale label Oct 24, 2023
Repository owner deleted a comment from github-actions bot Oct 25, 2023
Copy link

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

@github-actions github-actions bot added the Stale label Dec 25, 2023
@mayurankv mayurankv removed the Stale label Feb 12, 2024
@mayurankv
Copy link
Owner Author

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

@mayurankv
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working editing mode Relevant to Obsidian editing mode upstream Upstream issue
Projects
None yet
Development

No branches or pull requests

1 participant