Skip to content

Fix down arrow key not working after font size change#364

Open
objectiveous wants to merge 2 commits intoCodeEditApp:mainfrom
objectiveous:fix/arrow-keys-after-font-change
Open

Fix down arrow key not working after font size change#364
objectiveous wants to merge 2 commits intoCodeEditApp:mainfrom
objectiveous:fix/arrow-keys-after-font-change

Conversation

@objectiveous
Copy link

Description

After changing the font size, the down/up arrow keys stop moving the cursor across line boundaries. The root cause is that TextViewLayoutManager caches an estimated line height that isn't invalidated when the font changes. The moveDown:/moveUp: methods use this stale value to calculate the target point, which lands within the same line instead of the next one.

Fix:

  • Re-assign renderDelegate on the layout manager after font or line height multiplier changes, which forces the cached estimate to refresh.
  • Add explicit handleArrowKey dispatch so arrow keys with all modifier combinations (Shift, Option, Cmd) are handled correctly when the local event monitor intercepts them.
  • Add Control-N / Control-P support for Emacs-style vertical movement.

Related Issues

  • Related to cursor navigation after configuration changes

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

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

2 participants