Skip to content

feat: add source line number toggle - #5111

Open
masalha-alaa wants to merge 1 commit into
marktext:developfrom
masalha-alaa:feat/toggle-line-numbers
Open

feat: add source line number toggle#5111
masalha-alaa wants to merge 1 commit into
marktext:developfrom
masalha-alaa:feat/toggle-line-numbers

Conversation

@masalha-alaa

@masalha-alaa masalha-alaa commented Aug 13, 2026

Copy link
Copy Markdown

Closes #4033

Summary

Adds a View → Toggle Line Numbers option directly below Toggle Table of Contents.

The option shows or hides line numbers in Source Code Mode. When enabled, every line is numbered using CodeMirror’s existing line-number font and color. The preference is persisted and defaults to enabled to preserve the existing behavior.

Locale entries and automated tests are included.

Type of change

  • Bug fix (non-breaking, fixes an issue)
  • New feature (non-breaking, adds functionality)
  • Breaking change (causes existing functionality to change)
  • Documentation update

Test plan

  • New tests added
  • Manually tested on: Electron could not launch in the sandbox because Chromium process sockets are restricted.

Automated validation completed:

  • 738 unit tests passed
  • Lint passed
  • TypeScript checks passed
  • Production Electron build passed

Notes for reviewers [optional]

The focused E2E test covers menu placement, checked state, live hiding and showing, and sequential line numbering. It is included but could not be executed because of the sandbox limitation described above.


By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](LICENSE).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add line numbering for every line in Source Code Mode instead of every 5 lines

1 participant