1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:48:12 +00:00

HackStudio: Optionally pass line & column to open_file

This makes it easier to open a file at a specific location.
This commit is contained in:
Itamar 2021-08-27 16:18:00 +03:00 committed by Andreas Kling
parent 5cd030568f
commit 8fc9ec942e
3 changed files with 5 additions and 4 deletions

View file

@ -236,7 +236,7 @@ Vector<String> HackStudioWidget::selected_file_paths() const
return files;
}
bool HackStudioWidget::open_file(const String& full_filename)
bool HackStudioWidget::open_file(const String& full_filename, size_t line, size_t column)
{
String filename = full_filename;
if (full_filename.starts_with(project().root_path())) {
@ -298,6 +298,7 @@ bool HackStudioWidget::open_file(const String& full_filename)
current_editor().on_cursor_change = [this] { update_statusbar(); };
current_editor_wrapper().on_change = [this] { update_gml_preview(); };
current_editor().set_cursor(line, column);
update_gml_preview();
return true;