mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 20:25:07 +00:00
HackStudio: Support opening the same file in both editors
Hey, it actually works! You can now edit the same file in both editors and even the C++ highlighting updates correctly in both of them. :^)
This commit is contained in:
parent
9b13a3905b
commit
e2d7f585da
5 changed files with 26 additions and 7 deletions
|
@ -79,3 +79,12 @@ bool Project::add_file(const String& filename)
|
|||
m_model->update();
|
||||
return true;
|
||||
}
|
||||
|
||||
TextDocument* Project::get_file(const String& filename)
|
||||
{
|
||||
for (auto& file : m_files) {
|
||||
if (file.name() == filename)
|
||||
return &file;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue