Calling it as part of the insert method was error prone and often
led to slightly surprising behaviour, such as the <c-r><esc> hiding
the menu on <esc>.
Before performing the insertion, InsertCompleter::insert calls
try_accept() to accept any selected completion candidate. If there
is one, we fire InsertCompletionHide. If that one modifies the register
used by <c-r>, the inserted StringViews will be dangling.
Fix this by running try_insert first, and read from the register later.
Note that we call try_accept() twice but that's fine.
It would probably make more sense to copy the register before calling
insert() but I don't think it matters.
Closes#5220
Refactor ShellManager and pipe to feed lines from the buffer directly,
this should reduce memory use when piping big chunks of buffers.
The pipe output is still provided as a single big buffer.
On a musl system with clang 18.1.8 linking against libc++, 64ed046e breaks
the build with
src/unicode.hh:105:24: error: use of undeclared identifier 'wcwidth'
105 | const auto width = wcwidth((wchar_t)c);
though this doesn't happen on the same system with gcc 14.2.0 linking
against libstdc++.
Include <cwchar> again so wcwidth() is properly defined.
We set both ICRNL and INLCR, so there is no translation of \r to \n
and vice versa. This means that when the user presses the Enter key,
we always receive \r.
So a "\n" input byte can realistically only be sent by <c-j> (or
perhaps <c-J>), so we can interpret it as that.
This intentionally breaks users that rely on <c-j> doing the same
thing as <ret> on terminals that fail to disambiguate those two
(for example gnome-terminal).
This seems unavoidable; better teach them to map <c-j> separately
sooner rather than later.
This makes it possible to remove the pending clears whenever an
info/status line is explicitely added, removing a class of race
conditions introduced by the previous implementation.
A common pattern is for info/echo messages to be generated by idle
hooks but the clearing of previous info/echo was done immediately on
normal mode events. This led to flickering of the info box especially
when a hook was repeatidly generating the same info (like moving
a cursor in the same word where the hook reacts to the word under
the cursor).
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.
--
2.45.2
I configured :make to use a special makecmd for files called test.cpp.
hook global BufCreate .*/test.cpp %{
set-option buffer makecmd "g++ %val{buffile} && ./a.out"
}
Commit c93cb5c4d (Add a `fifo` helper command and refactor `make`
and `grep` to use it, 2024-06-07) made :make evaluate makecmd in the
toolsclient context instead of the calling context, so my buffer-local
override no longer applies. I'm not sure if this is something we want
to guarantee but it doesn't seem unreasonable, and we can fix it a
no cost I think.
Additionally, it changed
eval "${kak_opt_makecmd}" "$@";
to
$kak_opt_makecmd "$@"
meaning that the "&&" in my makecmd will no longer be evaluated.
Instead it will be passed as argument to g++, effectively
g++ %val{buffile} '&&' ./a.out
which I don't think is a reasonable expectation (unless we change
makecmd to be str-list options). Essentially, the above only applies
word splitting to makecmd; it seems simpler and less surprising to
treat them as raw shell commands.
Expand makecmd in the calling client again, and insert it verbatim
into the shell script.
grep hasn't needed it so far but keep it consistent.
previously, clicking on the status line if it is on the top of the
window results on a coord.line = 1 << 16, or there abouts. This is
because the expression
(key & 0xFFFF0000) >> 16
results in an `shr` instruction which does not propagate the sign
bit. Mouse event coordinates can be negative if the status line is
on top and the status line is clicked. The new line
(int32_t) (key & 0xFFFF0000) >> 16
properly propagates the sign bit, leading to the correct signed
numeric line coordinate.
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.
adds scroll amount in the upper 16-bits of `Key.modifiers`, reclaiming
the space in `Key.key` for coordinates. Previously, while mouse events
included their coordinates, scrolling did not. Scroll events are now
emitted as <scroll:amount:line.column>.