summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/EditingEngine.cpp
AgeCommit message (Collapse)Author
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-10-15LibGUI: Don't update selection twice after Ctrl-RightBen Wiederhake
2021-10-15LibGUI: Make Ctrl-Shift-Home/-End work againBen Wiederhake
Previously, the initial call to update_selection() was missing, so if no text was already selected, then Ctrl-Shift-End would only move the cursor to the document end, but not select any text.
2021-10-15LibGUI: Convert always-valid pointer to referenceBen Wiederhake
The pointer is always assumed to be non-null, so let's change it to a reference.
2021-08-22LibGUI: Make Ctrl+Shift+Right select textAndrew January
Ctrl+Shift+Left would add the word before the cursor to the selection, but for some reason Ctrl+Shift+Right didn't add the word after the cursor to the selection.
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-06-03Everywhere: Replace ctype.h to avoid narrowing conversionsMax Wipfli
This replaces ctype.h with CharacterType.h everywhere I could find issues with narrowing conversions. While using it will probably make sense almost everywhere in the future, the most critical places should have been addressed.
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-25Everywhere: Remove empty line after function body opening curly braceLinus Groh
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-03-30EditingEngine: Don't jump to the beginning or end of a non-existant wordone-some
Previously, when jumping to the next word on the last column of a line, or when jumping to the previous word on the first column, it would crash. This checks if that is the case, and if so, will do nothing.
2021-02-24LibGUI: Remove redundant cursor updateAngus Gibson
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2021-02-03TextEditor: Implement word wrappingZac
Add a new wrapping mode to the TextEditor that will wrap lines at the spaces between words. Replace the previous menubar checkbox 'Wrapping Mode' in HackStudio and the TextEditor with an exclusive submenu which allows switching between 'No wrapping', 'Wrap anywhere' and 'Wrap at words'. 'Wrap anywhere' (the new 'Wrap lines') is still the default mode. Setting the wrapping mode in the constructors of the TextEditorWidget and HackStudio has been removed, it is now set when constructing the menubar actions.
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-27EditingEngine: Fix move_to_previous_word not working on last char of docZac
Code meant for the move_to_next_word functions which set the cursor to the last character in the file if it was reached was copied into the move_to_previous_word functions which lead them not moving when the function was called from the end of the file.
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