This is just a wrapper around strstr() for now. There are many better
ways to search for a string within a string, but I'm just adding a nice
API at the moment. :^)
Add the ability to both pass arguments to scripts with shebangs
(./script argument1 argument2) and to specify them in the shebang line
(#!/usr/local/bin/bash -x -e)
Fixes#585
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.