Skip to content

Ensure consistent newline behavior in auto-height editors with JetBrains keymap#47595

Merged
Veykril merged 1 commit intozed-industries:mainfrom
dastrobu:fix-shift-enter-agent-panel
Mar 6, 2026
Merged

Ensure consistent newline behavior in auto-height editors with JetBrains keymap#47595
Veykril merged 1 commit intozed-industries:mainfrom
dastrobu:fix-shift-enter-agent-panel

Conversation

@dastrobu
Copy link
Copy Markdown
Contributor

@dastrobu dastrobu commented Jan 25, 2026

Add an explicit Editor && mode == auto_height context block. This ensures that Shift+Enter and Ctrl+Enter correctly insert a newline at the cursor position in editors like the AI Agent Panel,
preventing them from inheriting conflicting overrides (e.g., JetBrains mapping Shift+Enter to editor::NewlineBelow).

Closes #47269

Release Notes:

  • Fixed an issue where Shift+Enter would insert a newline at the end of the text instead of the cursor position in the Agent Panel when using certain keymaps.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 25, 2026
@zed-community-bot zed-community-bot bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Jan 25, 2026
@maxdeviant maxdeviant changed the title keymaps: ensure consistent newline behavior in auto-height editors keymaps: Ensure consistent newline behavior in auto-height editors Jan 25, 2026
@maxdeviant maxdeviant changed the title keymaps: Ensure consistent newline behavior in auto-height editors Ensure consistent newline behavior in auto-height editors with JetBrains keymap Jan 25, 2026
@dastrobu dastrobu force-pushed the fix-shift-enter-agent-panel branch from 9a595b1 to 247d1ad Compare January 25, 2026 18:27
@Veykril Veykril self-assigned this Jan 27, 2026
@dastrobu dastrobu force-pushed the fix-shift-enter-agent-panel branch from 247d1ad to da28815 Compare February 14, 2026 16:00
Copy link
Copy Markdown
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late reply, I think this sounds like a good way to fix this, can we replicate this to the linux keymap as well (which will mirror it for windows too)

@dastrobu dastrobu force-pushed the fix-shift-enter-agent-panel branch from da28815 to f5c7977 Compare February 20, 2026 15:01
@dastrobu
Copy link
Copy Markdown
Contributor Author

@Veykril thanks for the feedback. PR is updated with suggestions.

@dastrobu
Copy link
Copy Markdown
Contributor Author

dastrobu commented Mar 6, 2026

@Veykril sorry for pining again and thanks for the review and approval. Is there anything I can do to to get this merged? Should be a low risk change with big improvement for some users (like me) who use the Jetbrains base keymap.

@Veykril
Copy link
Copy Markdown
Member

Veykril commented Mar 6, 2026

Ah sorry, i thought this would merge after a workflow restart. I think you'll have to rebase on main for ci to unblock itself

keymap

Add an explicit `Editor && mode == auto_height` context block. This
ensures that `Shift+Enter` and `Ctrl+Enter` correctly
insert a newline at the cursor position in editors like the AI Agent
Panel,
preventing them from inheriting conflicting overrides (e.g., JetBrains
mapping `Shift+Enter` to `editor::NewlineBelow`).

Closes zed-industries#47269

Release Notes:

- Fixed an issue where `Shift+Enter` would insert a newline at the end
  of the text instead of the cursor position in the Agent Panel when
  using certain keymaps.
@dastrobu dastrobu force-pushed the fix-shift-enter-agent-panel branch from f5c7977 to 6e08929 Compare March 6, 2026 11:06
@dastrobu
Copy link
Copy Markdown
Contributor Author

dastrobu commented Mar 6, 2026

Ah sorry, i thought this would merge after a workflow restart. I think you'll have to rebase on main for ci to unblock itself

@Veykril did the rebase, but I think you need to approve the workflow run:
image

@Veykril Veykril enabled auto-merge (squash) March 6, 2026 11:24
@Veykril Veykril merged commit 77fa028 into zed-industries:main Mar 6, 2026
28 checks passed
@dastrobu dastrobu deleted the fix-shift-enter-agent-panel branch March 6, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shift+Enter inserts new line at end instead of cursor position

2 participants