Commit Graph

7 Commits

Author SHA1 Message Date
Andreas Kling
8f9a522c37 HackStudio: Highlight matching pairs of [ and ] as well
Also refactor the token pair matching code a little bit to not repeat
ourselves so much. :^)
2019-11-23 17:49:14 +01:00
Andreas Kling
15fb341eb4 HackStudio: Always re-match curlies/parens after a re-highlight
While you are typing in HackStudio, we re-lex the C++ as you type,
so this means we also need to keep re-checking for matching curlies and
parentheses at the cursor.

Fixes #769 (although it's not optional, because it's too cool. :^)
2019-11-18 19:21:18 +01:00
Andreas Kling
c8e02e60a6 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. :^)
2019-11-18 19:10:06 +01:00
João Paulo Pulga
4d3be45ff4 HackStudio: Don't parse documentation if already parsed 2019-11-05 07:06:15 +01:00
Andreas Kling
7c71040ba9 HackStudio: Show documentation preview in tooltip on identifier hover
When hovering over a C++ token that we have a man page for, we now show
the man page in a tooltip window.

This feels rather bulky at the moment, but the basic mechanism is quite
neat and just needs a bunch of tuning.
2019-10-30 20:28:44 +01:00
Andreas Kling
e2c74762ff HackStudio: Draw a brownish frame around the current editor widget
Also make the editor filename label bold only for the current editor.
2019-10-27 20:44:37 +01:00
Andreas Kling
e39b1f11f9 HackStudio: Support multiple editors on screen
This patch adds Editor (subclass of GTextEditor) and EditorWrapper.
An EditorWrapper is a composite widget that adds a little statusbar
above an Editor widget. The statusbar is used for showing the filename
and the current cursor position. More things can definitely be added.

To get to the currently active editor, call current_editor().
You can also get to the current editor's wrapper by calling..
current_editor_wrapper(). Which editor is current is determined by
which was was last focused by the user.
2019-10-27 12:55:10 +01:00