1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-07 08:17:36 +00:00

HackStudio: Use CodeDocument instead of TextDocument

This commit adds a new GUI widget type, called CodeDocument, which
is a TextDocument that can additionaly store data related to the
debugger.

This fixes various bugs and crashes that occured when we switched
between files in debug mode, because we previously held stale breakpoint
data for the previous file in the Editor object.
We now keep this data at the "document" level rather than the Editor
level, which fixes things.
This commit is contained in:
Itamar 2020-08-15 10:58:31 +03:00 committed by Andreas Kling
parent e793cc3d13
commit 627f258c97
9 changed files with 137 additions and 22 deletions

View file

@ -36,7 +36,7 @@ ProjectFile::ProjectFile(const String& name)
const GUI::TextDocument& ProjectFile::document() const
{
if (!m_document) {
m_document = GUI::TextDocument::create(nullptr);
m_document = CodeDocument::create(nullptr);
auto file = Core::File::construct(m_name);
if (!file->open(Core::File::ReadOnly)) {
ASSERT_NOT_REACHED();