1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 05:15:07 +00:00

HackStudio+LibGUI: Implement matching curly brace highlighting

This works for C++ syntax highlighted text documents by caching the C++
token type in a new "arbitrary data" member of GTextDocumentSpan.

When the cursor is placed immediately before a '{' or immediately after
a '}', we highlight both of these brace buddies by changing their
corresponding spans to have a different background color.

..and spans can also now have a custom background color. :^)
This commit is contained in:
Andreas Kling 2019-11-18 19:10:06 +01:00
parent 5f7f97355e
commit c8e02e60a6
6 changed files with 89 additions and 1 deletions

View file

@ -120,6 +120,7 @@ protected:
virtual void leave_event(CEvent&) override;
virtual void context_menu_event(GContextMenuEvent&) override;
virtual void resize_event(GResizeEvent&) override;
virtual void cursor_did_change() {}
GTextPosition text_position_at(const Point&) const;