Enter copies indent from the current line

Shift+Enter (GUI) and ESC-Enter (terminal) insert a raw newline.
Paste and prompts keep using Newline.
This commit is contained in:
2026-11-01 19:44:49 -08:00
parent a629a7fb0e
commit e701b416da
6 changed files with 42 additions and 12 deletions
+22
View File
@@ -97,3 +97,25 @@ TEST(KKeymap_EscChords_CanonicalChords)
ASSERT_EQ(KLookupEscCommand('z', id), false);
}
TEST(KKeymap_Enter_IsSmartNewline)
{
ASSERT_EQ(KEnterCommand(false), CommandId::SmartNewline);
}
TEST(KKeymap_ShiftEnter_IsNewline)
{
ASSERT_EQ(KEnterCommand(true), CommandId::Newline);
}
TEST(KKeymap_EscEnter_IsNewline)
{
CommandId id{};
ASSERT_TRUE(KLookupEscCommand('\n', id));
ASSERT_EQ(id, CommandId::Newline);
ASSERT_TRUE(KLookupEscCommand('\r', id));
ASSERT_EQ(id, CommandId::Newline);
}