Cache get fully invalidated whenever the regions change, so there
should be no risk of referencing a removed region, and this removes
one hash map lookup for every region in the displayed buffer range.
Range atoms should always appear in order, so we can iterate a single
time through the display lines and display atoms while applying
hightlighters to regions
modeline-parse leads by matching an expensive regex against the entire buffer,
which can take a long time on huge files.
Perl takes too long on this regex and it seems not even ripgrep
optimizes the \z component
$ ruby -e '10000.times { puts "a" * 10000 }' > big
$ time rg --multiline --only-matching '\A(.+\n){1,5}|(.+\n){1,5}\z' big | wc -l
10
__________________________
Executed in 419.81 millis
usr time 399.84 millis
sys time 20.78 millis
where
$ time kak big -e q
__________________________
Executed in 179.19 millis
usr time 133.61 millis
sys time 53.50 millis
Let's lose the regex.
Fixes#4911
When unmapping a key sequence that is currently executing, we continue
executing freed memory which can have weird effects. Let's instead
throw an error if that happens. In future we can support unmap in
this scenario.
Closes#4896
Sometimes we get people asking why <c-c> can't be mapped. It should be
mentioned in the `:help mapping` documentation, along with any other
unmappable keys.
The current implementation only does this during regex operations,
but should be extensible to other operations that might take a long
time by regularly calling EventManager::handle_urgent_events().
Although Kakoune responds to modified mouse events, they show up in the
debug buffer corrupted. to_string() tests for equality on the mouse event
modifiers rather than testing just the relevant bits, so the modified
mouse events incorrectly fall through to the normal key handling.
Fix this and restructure to allow mouse events to be modifier-prefixed.
Signed-off-by: Chris Webb <chris@arachsys.com>
I dedicate any and all copyright interest in this software to the
public domain. I make this dedication for the benefit of the public at
large and to the detriment of my heirs and successors. I intend this
dedication to be an overt act of relinquishment in perpetuity of all
present and future rights to this software under copyright law.
The x11-terminal command spawns a potentially long-lived terminal
process. The terminal can is completely independent of the Kakoune
session that created it.
Due to how it's implemented, the spawned terminals will have
environment variables "kak_opt_termcmd" and "kak_quoted_reg_a"
set. This can be surprising, especially since, by convention, the
environment contains no lowercase variables. Let's stop exporting them.
Change the initial <c-h>/<c-k> bindings to the recently freed-up
<a-u></a-U>.
Pros:
- easier to remember
- the redo binding is logical.
- works on legacy terminals, unlike <c-h>
Cons:
- It's less convenient to toggle between selection undo and redo
keys. I think this is okay since this scenario does not happen that
often in practice.
When launch matches using `id` kitty tries to match against tab id
before matching windows. When there are multiple tabs it's likely to
match a tab before matching a window.
Use `window_id` directly to avoid any possiblity of matching tabs.
This is only needed for `kitty @ launch` for other commands there is
no specific `window_id` field.
%exp{...} just expands its content the same way double quoted strings
do, but using a named expansion type makes it possible to use the
more quoting mechanism to avoid quoting hell.
This continues the work started by 0a9c90fec (rc: use a separate
*-insert hook to auto-insert comments, 2021-04-17).
The one that's left is Rust but that one is trickier.