Remove ExecState to store threads inside the ThreadedRegexVM so that
memory buffers can be reused between executions. Extract an ExecConfig
struct with all the data thats execution specific to avoid storing
it needlessly inside the ThreadedRegexVM.
If the local client was quitted during its creation (using -e quit
for example), we could have been accessing a null pointer afterwards.
Make the rest of the code aware that local_client might be null.
Shifted function keys are not well standardized around terminals,
Shift F(N) usually returns F(X) + N, with X=12 on xterm, X=10 on
rxvt-unicode... Default to X=12 and make it configuable through
the ncurses_shift_function_key ui_option.
This fixes what #1898 tried to.
Because keyboard layouts vary, the shift-modifier `<s-…>` is only supported
for special keys (like `<up>` and `<home>`) and for ASCII lowercase where
we assume the shift-modifier just produces the matching uppercase character.
Even that's not universally true, since in Turkish `i` and `I` are not an
uppercase/lowercase pair, but Kakoune's default keyboard mappings already
assume en-US mappings for mnemonic purposes.
Mappings of the form `<s-x>` are normalized to `<X>` when `x` is an ASCII
character. `<backtab>` is removed, since we can now say `<s-tab>`.
set-face now takes a scope argument, and faces can be overridden on
a buffer or window basis.
colorscheme apply on global scope, which should be good enough for
now.
Fixes#1411
Schedule it for later, when we get "idle". It currently can lead to
crashed because after the callback, the current mode might be different,
leading to a crash when doing the ModeChange hook call.
Session/Client/User modes names are now requiered to be "identifiers"
they must be in [a-zA-Z0-9_-]. Option names are the same except they
do not allow '-' as they need to be made available through the env vars
and '-' is not supported there.
Fixes#1946
In the end, % is not that painful to work with as its only set seldomly,
and we usually dont need to use expansion at the same time. Moreover, it
just requires a single \ to be escaped.
Fixes#1562
When Kakoune forked the sever to background, the newly converted
to client process (the original client/server process) was not
preserving its previous client name.
Letting any character to be escaped is error prone as it looks like
\l could mean [:lower:] (as it used to with boost) when it only means
literal l.
Fix the haskell.kak file as well.
Fixes#1945
As the computation of word boundary matches is separate from the
actual subsequence matching, we sometimes have candidate that match
as a single word while still having multiple word boundary matches.
For example, with query "expresins", candidate "expressionism's"
will match as single word ("expressins" is a subsequence of
"expressionism"), and will have two word boundaries match (it does
match the last "s", which is considered as a separate word).
This should not be taken into account when compared against
candidate "expresions", which should be considered a better
match.
Fixes#1925
Reference highlighters allow for potential mutual recursion between
highlighters. This is usually fine, but if the recursion happens on
the same buffer range, it means we will recurse infinitely.
Fixes#1920
Pressing Y or N will set the buffer (or window, if it is set at that
scope) autoreload option to the corresponding value, avoiding infinite
loops where a file getting constantly modified prevents the user from
using Kakoune.
To allow more general look arounds out of the actual search range,
pass a second range (the actual subject). This allows us to remove
various flags such as PrevAvailable or NotBeginOfSubject, which are
now easy to check from the subject range.
Fixes#1902
Change the logic of open line commands so that if a selection lies
on the end of line character of the line from which we open a new
line, that selection does not move.
If we have two clients, A and B, with B's cursor on the eol character
of line L, and A hits `o` while on line L, B's cursor should stay
on the same (logical) line. Previous behaviour would make B's cursor
jump on the newly inserted line.
Selection merging is necessary if we want X to work nicely when we are
on EOL (jumping to next line is as nice as it could be, and we are much
more often on EOL nowadays).