* added text overwriting
* rewrote `DocView:draw_caret` to not use the order of draws
* forgot to delete some old code in `DocView:draw_overlay`
also added a temporary solution to overwriting
and added the missing arguments in `DocView:draw_ime_decoration`
and fixed `DocView:draw_caret`
* accidentally broke the `draw_caret` call in `draw_overlay` in the process
* multiline
* fixed calling `Doc:get_char` as a function
that, in turn, crashed the editor because "can't index a number"
* move and rename some stuff
* remove unneeded extra check
I just had to change the `~=` to `<` in the second condition
* overwrite disregards pasting text
* disregard overwrite on selections; doc only removes selection
* Fixed error where `doc` was used, instead of `self`.
---------
Co-authored-by: ThaCuber <70547062+ThaCuber@users.noreply.github.com>
Co-authored-by: Adam Harrison <adamdharrison@gmail.com>
* Use normalized strokes when removing duplicates only when appropriate
* Use normalized stroke in `keymap.unbind`
* Normalize strokes by sorting the modifiers before the keys
This also sorts the modifiers in a fixed manner, decided by
`modkeys.keys`.
We need to do this because we display the strokes in a few places like
the command palette.
* Added in double-clicking on emptyview and tab bar.
* Fixed issue with split tabs.
* Early exit if no overlapping node.
* Changed category of command to tabbar.
* Additional cleanup.
* Changed for whether we should show tabs.
* Fixed erroneous hover.
* Add `Object:{is_class_of,is_extended_by}` to check inverse relationships
* Make tab scrolling more flexible
This adds tab scrolling commands and connects them to mouse scroll
events.
This way scrolling behavior can be customized more easily.
For example an alternative behavior could be:
```lua
keymap.add({
["wheelup"] = "root:switch-to-hovered-previous-tab",
["wheeldown"] = "root:switch-to-hovered-next-tab"
})
```
* Avoid updating IME input rect if it hasn't changed
* Update the IME input rect even when the composition didn't change
* Apply IME input blocking workaround to non-Linux only
Commonly `ctrl+shift+r` is used in most editors for find and
replace operations, also the regexreplacepreview.lua plugin makes
a more appropriate use of this binding.
* Prevent adding duplicate bindings
* Clean reverse_map on overwrite or add direct
* Added get_bindings to complement get_binding
* Added doc comments for easier comprehension
* Check if command is function on add_direct
This allows `keymap.add` to map shortcuts to functions.
If the function returns `false`, the next command is executed (as if the
`predicate` of a `command` failed).
Bring back the command like before to keep single selection but with
ctrl+f3 keybindings. Change the name of the new multi-cursor command
but keep the ctrl+d keybinding.