This makes Kakoune behave more consistently when using it for Zig.
Empty comments are already auto-removed from the C-family and Python.
In this PR, string literals that start with \\ are not removed in purpose.
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
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.
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.
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.
Why?
Most users who pass the current selection to grep likely do not intend to pass
the selection as a regex input string.
This makes the grepcmd use an additional -F flag to perform literal-string
matching for the current selection. The -F flag seems to be the standard flag
for literal-string matching in every grep implementation I've found.