mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:47:35 +00:00
Ladybird: Hook up console history into the AppKit console
This commit is contained in:
parent
204a6f9241
commit
8d66b9ea3f
1 changed files with 12 additions and 0 deletions
|
@ -133,6 +133,18 @@ static constexpr CGFloat const WINDOW_HEIGHT = 600;
|
||||||
textView:(NSTextView*)text_view
|
textView:(NSTextView*)text_view
|
||||||
doCommandBySelector:(SEL)selector
|
doCommandBySelector:(SEL)selector
|
||||||
{
|
{
|
||||||
|
if (selector == @selector(moveUp:)) {
|
||||||
|
if (auto script = m_console_client->previous_history_item(); script.has_value())
|
||||||
|
[text_view setString:Ladybird::string_to_ns_string(*script)];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selector == @selector(moveDown:)) {
|
||||||
|
if (auto script = m_console_client->next_history_item(); script.has_value())
|
||||||
|
[text_view setString:Ladybird::string_to_ns_string(*script)];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
if (selector != @selector(insertNewline:)) {
|
if (selector != @selector(insertNewline:)) {
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue