The real technical limit is with lines bigger than 2 GiB and buffers
with more than 2 Gi lines, refactor buffer loading to make it possible
to load those files.
Fix an overflow with the hash_data function at the same time
This fixes an issue where completion would still be provided after
the closing character of a token, which could then get frustrating
combined with auto-insertion of completions.
For example, inserting `%{<newline>}` for a command-completed token
(such as the commands for a hook) would still trigger completion right
after the `}` and that completion would get auto-inserted **replacing**
that closing `}`.
Do not use a shared kakoune/ directory for all users to avoid the
complexity of having to set the sticky bit on that dir, resolve the
session directoy only once by using a static variable and an
immediately evaluated lambda.
This fixes an annoyance whenver using `su` and having Kakoune refuse
to start due to XDG_RUNTIME_DIR still being set.
For historical reasons, mouse events represent keyboard modifiers as a bitfield,
but keyboard events represent modifiers as a bitfield-plus-one. For example, a
mouse event with an Alt modifier will use the value 4, but a keyboard event will
use the value 5.
Previously, I refactored the parse_mask() helper to do the subtraction itself,
instead of requiring the caller to do it. This made keyboard-event decoding much
cleaner, but I didn't realise it broke mouse-event decoding. Now the subtraction
is done only for keyboard events.
Fixes#4176.
In some cases, it may be difficult to easily spot the area out of the buffer
(bad color scheme, small font, superimposed windows).
This patch adds two ncurses ui_options to bypass this problem:
- `ncurses_padding_char`, to configure the padding character,
- `ncurses_padding_fill`, to indicate whether to fill the padding line
(or to display a single character).
The default config is the legacy one (a single "~").
- Add the Narrow No-Break SPace (0x202F, NNBSP) to the list of handled
spaces in the show-whitespace highlighter.
- Do not add an aditional option, just handle it like NBSP, with the same highlight character.
Quote by wrapping in quotes if we are replacing the whole token,
using backspaces if the completion only adds to it.
This ensure that the inserted completion will be correctly parsed
once validated.
Fixes#4121
Kakoune now knows about all the keypad keys listed in:
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-PC-Style-Function-Keyshttps://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-VT220-Style-Function-Keys
The VT220-style encodings are used to for modified numeric keys when NumLock is
off. For example, consider the 8/Up key:
| Modifiers | Sequence | Notes |
|-----------------|-------------|-------------------|
| Unmodified | CSI A | Ordinary up arrow |
| Shift | SS3 2 x | Shift-8 |
| NumLock | 8 | Ordinary 8 |
| Shift + NumLock | CSI 1 ; 2 A | Shift-Up |
Note that even though the terminal distinguishes between keypad and regular keys,
Kakoune maps keypad keys onto regular keys - keypad Enter is still <ret>, it
just supports more modifiers than the regular Enter key.
It's useful for parsing modifier masks in all kinds of sequences, not just CSI
sequences. Also, since the modifier mask always has "1" as "no modifiers",
do the subtraction inside parse_mask() instead of when calling it.
This avoids 100% CPU usage when we have pending fifo input while running
a shell process, as we will not end-up busy looping in pselect but not
reading the available data due to being only processing urgent events.