mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-13 10:26:37 +02: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:
Notes:
sideshowbarker
2024-07-19 03:36:54 +09:00
Author: https://github.com/itamar8910 Commit: https://github.com/SerenityOS/serenity/commit/627f258c975 Pull-request: https://github.com/SerenityOS/serenity/pull/3153 Issue: https://github.com/SerenityOS/serenity/issues/3152 Reviewed-by: https://github.com/awesomekling
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user