mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 07:07:23 +00:00
HackStudio: Unbreak jumping to a search result
I broke this when factoring out the find-in-files widget into its own class. This patch adds a main_editor() global getter for grabbing at the main GTextEditor from wherever you are.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <LibGUI/GListView.h>
|
||||
#include <LibGUI/GTextBox.h>
|
||||
|
||||
extern GTextEditor& main_editor();
|
||||
extern void open_file(const String&);
|
||||
extern OwnPtr<Project> g_project;
|
||||
|
||||
@@ -70,8 +71,8 @@ FindInFilesWidget::FindInFilesWidget(GWidget* parent)
|
||||
int line_number = parts[1].to_int(ok);
|
||||
ASSERT(ok);
|
||||
open_file(parts[0]);
|
||||
m_textbox->set_cursor(line_number - 1, 0);
|
||||
m_textbox->set_focus(true);
|
||||
main_editor().set_cursor(line_number - 1, 0);
|
||||
main_editor().set_focus(true);
|
||||
};
|
||||
|
||||
m_button->on_click = [this](auto&) {
|
||||
|
||||
Reference in New Issue
Block a user