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
+9 -2
View File
@@ -235,10 +235,17 @@ KLookupEscCommand(const int ascii_key, CommandId &out) -> bool
return true;
case '\n':
case '\r':
out = CommandId::SmartNewline; // Shift+Enter (some terminals send this as Alt+Enter sequences)
out = KEnterCommand(true); // ESC-Enter: raw newline (terminals rarely send Shift+Enter)
return true;
default:
break;
}
return false;
}
}
auto
KEnterCommand(const bool raw) -> CommandId
{
return raw ? CommandId::Newline : CommandId::SmartNewline;
}