summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/EditingEngine.h
AgeCommit message (Collapse)Author
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-07-19LibGUI: Add MoveLineUpOrDownCommandLucas CHOLLET
This allows lines moved by Ctrl+Shift+[Up, Down] to be registered as a command, i.e. cancellable by Ctrl+Z. This patch also introduces the usage of TextDocument::[take, insert]_line. Those functions forward changes to the visual lines and then avoid some data mismatch. Co-authored-by: Jorropo <jorropo.pgm@gmail.com>
2022-07-15LibGUI: Fix weird behavior when using Ctrl+Shift+[Up,Down] in TextEditorLucas CHOLLET
Those inconveniences come from cursor and selection not being saved during the switch.
2022-04-23LibGUI: Remove unused functions in EditingEngine classMoustafa Raafat
2022-04-01Everywhere: Run clang-formatIdan Horowitz
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-12-09LibGUI: Add EngineType to EditingEngine classesscwfri
This will allow users of EditingEngine classes to determine current type of EditingEngine (currently either vim or regular).
2021-10-15LibGUI: Don't update selection twice after Ctrl-RightBen Wiederhake
2021-07-15VimEditingEngine: Operate on real lines rather than wrapped onesMatthew Hall
In the normal editing engine keys like Home, End etc work on visual lines, but vim operates on real ones. Eg if you have a really long line and wrapping is on then in normal editing Home would take you to the beginning of the wrapped line, but 'I' would put you insert mode at the beginning of the real line in vim.
2021-04-27EditingEngine: Split selection from movement functionssin-ack
This patch moves selection updates outside movement functions in EditingEngine. Previously, movement functions would automatically update the selection based on whether the Shift key was pressed down during movement. However, not all EditingEngine subclasses want that; VimEditingEngine being a good example (because all selection is handled in visual mode). Therefore, this patch moves all selection updating to EditingEngine::on_key(). Subclasses wishing to provide custom movement and selection semantics should override it (and VimEditingEngine already does).
2021-04-25LibGUI: Implement Vim motion systemsin-ack
This patch implements Vim motions. The VimMotion class will accept keycodes from the editing engine to build up a motion, and will signal when a motion is complete via VimMotion::is_complete(). The editing engine can then call VimMotion::get_range() to obtain a TextRange object which can be used to perform operations on the text, or VimMotion::get_position() to obtain a TextPosition which is the new position of the cursor after the motion. Currently, the following motions are supported: - h/j/k/l, regular Vim line and character movements - 0/^/$, start/end of line and start of non-blank - w/e/b/ge, word-related movements - W/E/B/gE, WORD (anything non-blank) versions of the above motions - gg/G, document related movements - t/f, to/find character All motions except gg/G accept a number prefix to repeat the motion that many times. This patch updates insert, normal and visual modes to use this motion system for movement.
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-02-02Revert "TextEditor: Add vim status indicators to the statusbar"Andreas Kling
This reverts commit bd6d0d229581e830c7a69cdb29252b9f63e0434a.
2021-02-02TextEditor: Add vim status indicators to the statusbarZac
When using the VimEditingEngine in the TextEditor, vim's mode and the previous key are shown in the editor's statusbar.
2021-01-28Vim: Add change word and delete word functionalityZac
Add the functionality of key sequences 'cw', 'ce', 'cb', 'dw', 'de' and 'db'.
2021-01-24Vim: More correct word jumping (#5090)Zac
Implemented move_to_beginning_of_next(), move_to_end_of_next(), move_to_beginning_of_previous() and move_to_end_of_previous() functions for more correct word jumping than the move_to_xxx_span() methods that were previously used.
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling