code-snippets icon indicating copy to clipboard operation
code-snippets copied to clipboard

Fix cursor misalignment issue with long code snippets

Open code-snippets-bot opened this issue 3 weeks ago • 1 comments

Current behavior

The writing cursor becomes vertically misaligned as the number of lines in a code snippet increases. By around 2000 lines, the cursor is noticeably elevated, and by 3000 lines, it is significantly off, making text selection difficult.

Expected behavior

The cursor should remain properly aligned regardless of the number of lines in the code snippet, similar to the behavior in other editors like Sublime or TextEdit.

Steps to reproduce

  1. Create a code snippet with 2000 to 3000 lines.
  2. Observe the cursor alignment as you add more lines.

WordPress version

Please specify the version of WordPress you are using.

Code Snippets version

Please specify the version of Code Snippets you are using.

Code Snippets license

Core (free)

Anything else?

Attached images demonstrate the misalignment issue: image.png, cursor_alignment.png


conversation id: m232raeq-d92b9b05-b1e3-423f-810b-3ad240c05622

code-snippets-bot avatar Dec 04 '25 12:12 code-snippets-bot

Image

imantsk avatar Dec 04 '25 12:12 imantsk

Tested further to eliminate external factors.

  1. Deleted all code from Customize/CSS
  2. Disabled ALL Code snippets.
  3. Disabled ALL plugins except Code Snippet Pro.
  4. Changed theme to twenty-twenty-four
  5. Added 1 new snippet containing only the number 1 down to several thousands rows.

Issue persists. Only becomes noticeable after a thousand or two thousand rows, but gets increasingly worse the more rows you add. Issue not related to computer (Macbook M4 Air), other text editors (eg. Sublime) have no issue.

Image

ozzymuppet avatar Dec 10 '25 07:12 ozzymuppet