We were checking the columns of the whole selection instead of the
the specfic line were modifying. Because of this, the selection
remained if the selection's column on another line was less than
the cursor.
To expand a bit on how the line-wrapping works, each physical line of
text is broken up into multiple visual lines. This is recomputed when
the document changes, or when the widget is resized.
Each GTextEditor::Line keeps track of the visual breaking points, and
also their visual rect in content coordinates. This allows us to do
painting and hit testing reasonably efficiently for now.
This code needs some cleanup, but it's finally in a working state, so
here it goes. :^)
This is not finished, but since the feature is controlled by a runtime
flag, the broken implementation should not affect users of this widget
too much (in theory :^).)
We use consumable annotations to catch bugs where you get the .value()
of an Optional before verifying that it's okay.
The bug here was that only has_value() would set the consumed state,
even though operator bool() does the same job.
- TmpFSInode::write_bytes() needs to allow non-zero offsets
- TmpFSInode::read_bytes() wasn't respecting the offset
GCC puts the temporary files generated during compilation in /tmp,
so this exposed some bugs in TmpFS.
KBuffer is just meant to be a dumb wrapper around KBufferImpl.
With this change, we actually start to see KBuffers with different size
and capacity, which allows some reallocation-avoiding optimizations.
Rewrite this function to go from left-to-right instead of right-to-left
since this allows us to accumulate valid characters before encountering
any invalid ones.
This fixes parsing of strings emitted by GCC, like "1, %0|%0, %1}". :^)
This papers over an immediate issue where pseudoterminals would choke
on more than 16 characters of pasted input in the GUI terminal.
Longer-term we should find a more elegant solution than using a static
size CircularQueue for this.
This patch adds basic keyboard access to the search box. We also yield
focus back gracefully to the text document when the search box is no
longer wanted.
Focus should probably move automatically when an ancestor of the
currently focused widget if made invisible..
The scheduler is not allowed to take locks, so if that's happening,
we want to make that clear instead of crashing with the more general
"Interrupts disabled while trying to take Lock" error.
- GTextRange find(const StringView& needle, const GTextPosition& start)
This function searches for the needle in the haystack (the full text)
and returns a GTextRange for the closest match after "start".
If the needle is not found, it returns an invalid GTextRange.
If no "start" position is provided, the search begins at the head of
the text document. :^)