mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-15 14:02:20 +00:00
Ladybird: Hook up console history into the AppKit console
This commit is contained in:
parent
204a6f9241
commit
8d66b9ea3f
Notes:
sideshowbarker
2024-07-17 05:00:08 +09:00
Author: https://github.com/trflynn89
Commit: 8d66b9ea3f
Pull-request: https://github.com/SerenityOS/serenity/pull/20851
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