Skip to content

Fix/clip line number gutter to match editor viewport height#518

Open
rachel-d-07 wants to merge 3 commits into
imDarshanGK:mainfrom
rachel-d-07:fix/editor-line-number-overflow
Open

Fix/clip line number gutter to match editor viewport height#518
rachel-d-07 wants to merge 3 commits into
imDarshanGK:mainfrom
rachel-d-07:fix/editor-line-number-overflow

Conversation

@rachel-d-07
Copy link
Copy Markdown

@rachel-d-07 rachel-d-07 commented May 30, 2026

Description

Line numbers in the code editor continued rendering outside the
bordered editor container when code exceeded ~22 lines.

Fixed by using requestAnimationFrame to sync the line numbers div
height to the editor's clientHeight after each render cycle,
preventing overflow beyond the visible editor boundary.

Related Issue

Fixes #403

Type of change

  • Bug fix
  • New feature / enhancement
  • Documentation update
  • Test addition
  • Refactor

Checklist

  • I have read CONTRIBUTING.md
  • My branch is up to date with main
  • I have run pytest -v and all tests pass
  • I have not introduced duplicate issues or features
  • My PR title follows the format: feat/fix/docs/test: short description
  • I have added tests for new features (Level 2 and 3 issues)
  • No hardcoded secrets or API keys in my code
  • This PR is linked to a GSSoC 2026 issue

Screenshots (if frontend change)

Before
Screenshot 2026-05-30 132426

After
image

Test evidence

This is a frontend-only JavaScript fix. No backend changes were made.
pytest is not applicable for this change.

Manual testing performed:

  • Loaded sample code (28 lines) → line numbers stay inside editor border
  • Typed 30+ lines manually → no overflow below editor boundary
  • Tested in Chrome on Windows

@rachel-d-07 rachel-d-07 changed the title Fix/editor line number overflow Fix/clip line number gutter to match editor viewport height May 30, 2026
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.

[Bug] Line Numbers Overflow Outside Code Editor Container

2 participants