From 77fa02889e535c751a78fa6090180975880b6daf Mon Sep 17 00:00:00 2001 From: Daniel Strobusch <1847260+dastrobu@users.noreply.github.com> Date: Fri, 6 Mar 2026 12:34:58 +0100 Subject: [PATCH] Ensure consistent newline behavior in auto-height editors with JetBrains keymap (#47595) 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. --- assets/keymaps/linux/jetbrains.json | 7 +++++++ assets/keymaps/macos/jetbrains.json | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/assets/keymaps/linux/jetbrains.json b/assets/keymaps/linux/jetbrains.json index bdf3949b3f9203220978ff599e0187513d6a976f..98d5cf93106f35e488ab70a60468fa2239cb08c0 100644 --- a/assets/keymaps/linux/jetbrains.json +++ b/assets/keymaps/linux/jetbrains.json @@ -81,6 +81,13 @@ "ctrl-\\": "assistant::InlineAssist", }, }, + { + "context": "Editor && mode == auto_height", + "bindings": { + "shift-enter": "editor::Newline", + "ctrl-shift-enter": "editor::NewlineBelow", + }, + }, { "context": "BufferSearchBar", "bindings": { diff --git a/assets/keymaps/macos/jetbrains.json b/assets/keymaps/macos/jetbrains.json index c9106e4d49671f16917b1322824c2edfcd0e7700..8612e07c4719dfdbf67762c89505cc2da0cfa000 100644 --- a/assets/keymaps/macos/jetbrains.json +++ b/assets/keymaps/macos/jetbrains.json @@ -79,6 +79,13 @@ "cmd-\\": "assistant::InlineAssist", }, }, + { + "context": "Editor && mode == auto_height", + "bindings": { + "shift-enter": "editor::Newline", + "ctrl-shift-enter": "editor::NewlineBelow", + }, + }, { "context": "BufferSearchBar", "bindings": {