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:
+9
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user