-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Fix down arrow navigation in last notebook cell to move cursor to end of line #251156
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
Conversation
… of line Co-authored-by: Yoyokrazy <12552271+Yoyokrazy@users.noreply.github.com>
…tion Co-authored-by: Yoyokrazy <12552271+Yoyokrazy@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested on macos, this does not fix the issue.
Co-authored-by: Yoyokrazy <12552271+Yoyokrazy@users.noreply.github.com>
I've identified and fixed the issue. The problem was in my cursor movement logic - I was incorrectly trying to execute The fix now properly handles the case where pressing down arrow in the middle of the last line moves the cursor to the end of that line using Please test with commit 42819bf. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.ts
Outdated
Show resolved
Hide resolved
- Check NOTEBOOK_EDITOR_CURSOR_LINE_BOUNDARY context key - Only move to end of line when cursor boundary is 'start' or 'none' - Use ICellViewModel's setSelections method for cursor positioning - Apply logic to any cell on last line, not just last cell - Preserve existing behavior for last cell navigation Co-authored-by: Yoyokrazy <12552271+Yoyokrazy@users.noreply.github.com>
Fix was simple, I found the context key but for whatever reason I didn't feel like using it in the when clause like the universe intended. I gave copilot some poor instructions to start with. |
When pressing the down arrow key while the cursor is in the middle of the last line in the last notebook cell, the cursor should move to the end of that line. Previously, the notebook navigation action would intercept the key press and do nothing, preventing normal editor behavior.
Root Cause
The issue was in the
FocusNextCellAction
where:Solution
Modified
FocusNextCellAction.runWithContext
to:cursorDown
editor commandExample
The fix preserves all existing cell navigation behavior while enabling proper cursor movement within the last cell.
Fixes #216172.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
electronjs.org
node-gyp
(dns block)If you need me to access, download, or install something from one of these locations, you can either: