Age | Commit message (Collapse) | Author |
|
This adds shortcut for inserting a new empty indented line
above/below current cursor position.
- <Ctrl-Return> for inserting line below.
- <Ctrl-Shift-Return> for inserting line above.
|
|
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
|
|
|
|
|
|
This method is similar in all respects to remove_line except that it
returns the removed line.
|
|
Affected classes are children of TextDocumentUndoCommand:
- InsertTextCommand
- RemoveTextCommand
- ReplaceAllTextCommand
|
|
Selected text is unindented when Shift+Tab is pressed. Select text,
indent it with Tab, then unindent with Shift+Tab.
|
|
If selected text is less than a whole line, usual delete/replace takes
place. Otherwise, if the selected text is a whole line or spans
multiple lines, the selection will be indented.
|
|
|
|
|
|
|
|
|
|
|
|
TextDocument::set_spans() now also takes a "span collection index"
argument.
TextDocument keeps a map between a span collection index and its spans.
It merges the spans from all collections into a single set of spans
whenever set_spans() is called.
This allows us to style a document with multiple layers of spans, where
as previously we only supported a single layer of spans that was set
from the SyntaxHighlighter.
|
|
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules
"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
|
|
|
|
This is a helpful option to prevent unwanted side effects, distinguish
between user and programmatic input, etc. Sliders and SpinBoxes were
implementing it idiosyncratically, so let's generalize the API and
give Buttons and TextEditors the same ability.
|
|
In Vim's insert mode, Ctrl-W deletes the word before the cursor, like
Ctrl-Backspace. Unlike Ctrl-Backspace, if only whitespace exists between
the end of the word and the cursor, the word will be deleted with the
whitespace.
To do so, this commit introduces two methods: delete_previous_word() for
TextEditor and first_word_before() for TextDocument, where the former
depends on the latter. delete_previous_word() is then called in
VimEditingEngine.
|
|
And use them to highlight javascript in HTML source.
This commit also changes how TextDocumentSpan::data is interpreted,
as it used to be an opaque pointer, but everyone stuffed an enum value
inside it, which made the values not unique to each highlighter;
that field is now a u64 serial id.
The syntax highlighters don't need to change their ways of stuffing
token types into that field, but a highlighter that calls another
nested highlighter needs to register the nested types for use with
token pairs.
|
|
This is no longer used since commands handle merging themselves.
|
|
We can now show things like "Undo Insert Text" and "Redo Remove Text"
instead of just "Undo" and "Redo" in menu items. Pretty neat! :^)
|
|
When deleting text by pressing backspace, the commands will be merged
into a single RemoveTextCommand.
|
|
When performing multiple text insertions in a row, they will now
be merged into a single InsertTextCommand.
|
|
Have TextDocument listen for state changes on the internal undo stack,
and forward those to all clients via a new virtual function.
This simplifies updating the can_undo / can_redo states of TextEditor.
|
|
|
|
This replaces the repeating 2-sec timer with a debounced single-shot
timer on user input.
|
|
Use is<T> to check for specific types of command in HackStudio instead
of cluttering up GUI::Command with specialized getters.
|
|
Until now, this has been hackishly tracked by the TextEditor app's
main widget. Let's do it in GUI::TextDocument instead, so that anyone
who uses this class can know whether it's modified or not.
|
|
SPDX License Identifiers are a more compact / standardized
way of representing file license information.
See: https://spdx.dev/resources/use/#identifiers
This was done with the `ambr` search and replace tool.
ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
|
|
|
|
|
|
Adds simple ASCII case matching and wrap around toggles to
TextEditor's find/replace widget and reorganizes its layout
|
|
This is a little bit messy but the basic idea is:
Syntax::Highlighter now has a Syntax::HighlighterClient to talk to the
outside world. It mostly communicates in LibGUI primitives that are
available in headers, so inlineable.
GUI::TextEditor inherits from Syntax::HighlighterClient.
This let us to move GUI::JSSyntaxHighlighter to JS::SyntaxHighlighter
and remove LibGUI's dependency on LibJS.
|
|
|