1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +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

@ -58,7 +58,7 @@ public:
const TextDocument& document() const { return *m_document; }
TextDocument& document() { return *m_document; }
void set_document(TextDocument&);
virtual void set_document(TextDocument&);
bool has_visible_list() const { return m_has_visible_list; }
void set_has_visible_list(bool);
@ -175,7 +175,7 @@ protected:
virtual void context_menu_event(ContextMenuEvent&) override;
virtual void resize_event(ResizeEvent&) override;
virtual void theme_change_event(ThemeChangeEvent&) override;
virtual void cursor_did_change() { }
virtual void cursor_did_change() {}
Gfx::IntRect ruler_content_rect(size_t line) const;
TextPosition text_position_at(const Gfx::IntPoint&) const;