With this patch, you can now assign the same GTextDocument to multiple
GTextEditor widgets via GTextEditor::set_document().
The editors have independent cursors and selection, but all changes
are shared, and immediately propagate to all editors.
This is very unoptimized and will do lots of unnecessary invalidation,
especially line re-wrapping and repainting over and over again.
This patch decouples GTextDocument and GTextDocumentLine from the line
wrapping functionality of GTextEditor.
This should basically make it possible to have multiple GTextEditors
editing the same GTextDocument. Of course, that will require a bit more
work since there's no paint invalidation yet.
The idea here is to decouple the document from the editor widget so you
could have multiple editors being views onto the same document.
This doesn't work yet, since the document and editor are coupled in
various ways still (including a per-line back-pointer to the editor.)
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.
This makes double-clicking on a C++ token in HackStudio select the
whole token, which is pretty nice. It's not perfect in all cases,
but a lot nicer than just expanding until we hit whitespace. :^)
This makes the backspace erase backwards until the next soft tab stop.
We currently always use 4 as the soft tab width, but I suppose we could
make it configurable at some point. :^)
By "hide" I really mean collapse them down to 24px height. We grow them
to a normal size when they're needed. The user is also free to resize
them at will.
This keeps them out of the way when you just want to do editing. :^)
Instead of only doing a relayout in the widget you're invalidating,
we now do a recursive top-down relayout so everything gets updated.
This fixes invalid results after updating a preferred size in some
situations with nested layouts.
Add a list of hard-coded standard types (including AK types) and show
them in a different style.
Rehighligt the file whenever it changes. (This is very inefficient but
makes it much easier to experiment.)
Also keep tweaking the colors. :^)
When we open a file whose name ends in ".cpp", we now pass the contents
through CppLexer, which produces a CppToken stream.
Those CppTokens are then converted into GTextEditor::Spans and handed
over to GTextEditor which then colorizes the source code accordingly.
This is pretty neat. :^)
It's now possible to give GTextEditor a vector of Span objects.
Spans currently tell the editor which color to use for each character
in the span. This can be used to implement syntax highlighting :^)
Added a window creation callback to GApplication that gets called
by GWindow which will reset any pending exit request in the
CEventLoop.
This is to prevent a bug which prevents your application from
starting up if you had a message box or other dialog before
showing your main application form. The bug was triggered by
there being no more visible windows which was triggering a
premature quit().
I broke this when factoring out the find-in-files widget into its own
class. This patch adds a main_editor() global getter for grabbing at
the main GTextEditor from wherever you are.
I have no idea why this was here. It makes no sense. If you're trying
to find out if something is a directory, why wouldn't you be allowed to
ask that about a FIFO? :^)
Thanks to Brandon for spotting this!
Also, while we're here, cache the directory state in a bool member so
we don't have to keep fetching inode metadata when checking this
repeatedly. This is important since sys$read() now calls it.
This is the closest I could figure out how to get to what's actively
running on the terminal view at the moment.
Perhaps we can bundle up every process with the same tty and sum it
all up somehow. I'm not sure.
This makes tcgetpgrp() on a master PTY return the PGID of the slave PTY
which is probably what you are looking for. I'm not sure how correct or
standardized this is, but it makes sense to me right now.
We now have a little widget that sits above the terminal view in the
build/application console. When a child process is running, we show its
PID, name, scheduling counter, and amount of resident memory in a live
little overview.
This is not working right just yet, since we don't know how to get to
the actually active PID on the TTY. Or, well, we find the active PID by
looking at the PGID of our fork()ed child.
This manages to find children spawned by Shell, but not children
spawned by make, for instance. I need to figure out how to find those.
We now return EISDIR whenever a program attempts to call sys$read
on a directory. Previously, attempting to read a directory could
either return junk data or, in the case of /proc/, cause a kernel
panic.
When using the bounded string operations (e.g. snprintf), the null
terminator was always being written even if there was no space for
it (or indeed any valid buffer at all)
This overwriting caused segmentation faults and memory corruption