From 6843ff3f9c176ed3a28100e1e68c9c1114fc0e82 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Tue, 28 Jul 2026 20:20:42 +0800 Subject: [PATCH] no-mistakes(document): document rebindable InsertNewline chords; fix rustfmt and changelog link --- docs/features.md | 2 +- docs/features.zh-CN.md | 2 +- src/terminal/view.rs | 6 +++++- src/ui/keymap.rs | 4 +--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/features.md b/docs/features.md index 1b0efa79..10d35378 100644 --- a/docs/features.md +++ b/docs/features.md @@ -10,7 +10,7 @@ - **Fuzzy history search** — ⌃ R shows what you ran, where, and whether it failed; turn it off (Settings → Terminal → Keyboard, or `history_search` in `config.json`) and ⌃ R goes to your shell instead, so an fzf / percol binding keeps working - **History from day one** — your existing shell history works as-is and carries across sessions - **Line editing** — click to place the caret, mouse selection, word motion, undo -- **Multi-line editing** — wrapped and multi-line commands edit in place; the grid shifts to keep the caret visible +- **Multi-line editing** — wrapped and multi-line commands edit in place; the grid shifts to keep the caret visible. ⇧ ⏎ · ⌥ ⏎ insert a newline instead of submitting (rebindable as `InsertNewline`); a plain submits the whole buffer ## In the window diff --git a/docs/features.zh-CN.md b/docs/features.zh-CN.md index 94730bb6..988bd1b1 100644 --- a/docs/features.zh-CN.md +++ b/docs/features.zh-CN.md @@ -10,7 +10,7 @@ - **模糊历史搜索** —— ⌃ R 看到每条命令在哪跑的、什么时候、有没有失败;关掉它(设置 → 终端 → 键盘,或 `config.json` 里的 `history_search`)后 ⌃ R 直接交给 shell,你绑的 fzf / percol 照常可用 - **历史开箱即用** —— 你已有的 shell 历史直接生效,并跨会话延续 - **行编辑** —— 点击定位光标、鼠标选区、词级移动、撤销 -- **多行编辑** —— 折行和多行命令原地编辑;网格自动上移,光标始终可见 +- **多行编辑** —— 折行和多行命令原地编辑;网格自动上移,光标始终可见。⇧ ⏎ · ⌥ ⏎ 插入换行而不提交(可改绑,动作名 `InsertNewline`),单独按 提交整个缓冲区 ## 窗口 diff --git a/src/terminal/view.rs b/src/terminal/view.rs index c519d17e..4edb8978 100644 --- a/src/terminal/view.rs +++ b/src/terminal/view.rs @@ -8781,7 +8781,11 @@ mod gpui_tests { vcx.simulate_keystrokes("shift-enter"); window .update(cx, |view, _, _| { - assert_eq!(view.cmd.text(), "echo a\n\n\n", "the chord survives a rebind"); + assert_eq!( + view.cmd.text(), + "echo a\n\n\n", + "the chord survives a rebind" + ); }) .unwrap(); } diff --git a/src/ui/keymap.rs b/src/ui/keymap.rs index de640377..03ac1478 100644 --- a/src/ui/keymap.rs +++ b/src/ui/keymap.rs @@ -850,9 +850,7 @@ mod tests { assert!(keystroke_is_valid(key), "{key} does not parse"); assert!(make_binding("InsertNewline", key).is_some()); assert!( - bound_keystrokes(&effective) - .iter() - .any(|(k, _)| k == key), + bound_keystrokes(&effective).iter().any(|(k, _)| k == key), "{key} is not remembered as installed" ); }