summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/TextDocument.h
AgeCommit message (Collapse)Author
2022-12-11LibGUI: Add shortcut for inserting new lineSnow
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.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
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 :^)
2022-11-27TextEditor: Add UndoCommands for commenting and uncommenting linesKyle Lanmon
2022-11-27TextEditor: Add utility to keep a range of text within a lineKyle Lanmon
2022-07-19LibGUI: Add TextDocument::take_line(size_t line_index)Lucas CHOLLET
This method is similar in all respects to remove_line except that it returns the removed line.
2022-07-19LibGUI: Add a default virtual destructor to virtual classesLucas CHOLLET
Affected classes are children of TextDocumentUndoCommand: - InsertTextCommand - RemoveTextCommand - ReplaceAllTextCommand
2022-07-08LibGUI: Unindent selected text on shift+tab presshuttongrabiel
Selected text is unindented when Shift+Tab is pressed. Select text, indent it with Tab, then unindent with Shift+Tab.
2022-07-08LibGUI: Indent selected text on tab presshuttongrabiel
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.
2022-04-26LibGUI: Don't merge TextDocumentUndoCommand if too much time has elapsedForLoveOfCats
2022-04-13LibGUI: Make class final and seperate from GML PlaygroundSimonFJ20
2022-04-13LibGUI+GMLPlayground: Replace text using ReplaceAllTextCommandSimonFJ20
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-29LibGUI: Add match_case parameter to TextDocument::find_all()Itamar
2022-03-29LibGUI: Support multiple layers of TextDocument spansItamar
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.
2022-03-12Libraries: Use default constructors/destructors in LibGUILenny Maiorani
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."
2021-11-11Everywhere: Pass AK::StringView by valueAndreas Kling
2021-09-22LibGUI: Rename CallOnChange => AllowCallback and implement elsewherethankyouverycool
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.
2021-07-20LibGUI: Add Ctrl-W to insert modeAriel Don
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.
2021-06-07LibWeb+LibSyntax: Implement nested syntax highlightersAli Mohammad Pur
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.
2021-05-08LibGUI: Remove now-unused undo coalescing timer from GUI::TextEditorAndreas Kling
This is no longer used since commands handle merging themselves.
2021-05-08LibGUI: Show command name in GUI::TextEditor undo/redo action textAndreas Kling
We can now show things like "Undo Insert Text" and "Redo Remove Text" instead of just "Undo" and "Redo" in menu items. Pretty neat! :^)
2021-05-08LibGUI: Implement merging of TextDocument's RemoveTextCommandAndreas Kling
When deleting text by pressing backspace, the commands will be merged into a single RemoveTextCommand.
2021-05-08LibGUI: Implement merging of TextDocument's InsertTextCommandAndreas Kling
When performing multiple text insertions in a row, they will now be merged into a single InsertTextCommand.
2021-05-08LibGUI: Use UndoStack::on_state_change inside TextDocument/TextEditorAndreas Kling
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.
2021-05-06LibGUI: Remember modified state on undo/redo actionsCarlos César Neves Enumo
2021-05-03LibGUI: Debounce TextDocument undo stackCarlos César Neves Enumo
This replaces the repeating 2-sec timer with a debounced single-shot timer on user input.
2021-05-02LibGUI+HackStudio: Remove editing specific hacks from GUI::CommandAndreas Kling
Use is<T> to check for specific types of command in HackStudio instead of cluttering up GUI::Command with specialized getters.
2021-05-01LibGUI: Track modified state in GUI::TextDocumentAndreas Kling
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.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
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 *
2021-04-21LibGUI: Prevent selecting empty line in TextEditor on double click (#6537)Rafał
2021-03-21LibGUI: Allow TextDocument::set_text to failItamar
2021-02-22TextEditor+LibGUI: Add case matching and wrap around optionalitythankyouverycool
Adds simple ASCII case matching and wrap around toggles to TextEditor's find/replace widget and reorganizes its layout
2021-02-07LibSyntax+LibGUI+LibJS: Move JS syntax highlighter to LibJSAndreas Kling
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.
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling