| Age | Commit message (Collapse) | Author |
|
This makes <c-g> cancel the writing operation if we block on trying
to open a fifo with no reader.
Fixes #5256
|
|
Commit 9cf8a3ccd (Check for buffer overflow when constructing the socket path., 2022-04-07)
made
$ kak -s $(printf %0100d)
fail but forgot to do the same for
$ kak -e "rename-session $(printf %0100d)"
which silently succeeds, only to fail at the next
$ echo nop | kak -p $(printf %0100d)
Fatal error: socket path too long: '/run/user/1000/kakoune/0000...'
Let's fail earlier.
While at it, don't validate "m_session" redundantly.
I'm not sure if we should validate the socket names in "kak -clear";
I guess it doesn't matter.
|
|
This changes the behaviour with say line numbers and other line
flags, but can be opted out by using final faces
Fixes #5253
|
|
I noticed that reverse searches ending in "." stopped working in
version 2024.05.08:
kak -n -e "exec %{%cfoobar<ret><esc>gj<a-/>foo.<ret>}'
Bisects ca7471c25 (Compute StartDesc with an offset to effective start,
2024-03-18) which updated the find_next_start() logic for the forward
case but not for backward case. Add a symmetrical change and test
case, that seems to fix it. Not 100% sure if this is correct but
feels so.
|
|
The general is_horizontal_blank supports various unicode blanks,
but passing an utf8 continuation byte to it can lead to surprising
results as we can match with 0xA0 (when char is unsigned).
Fixes #5250
|
|
Fixes #4957
|
|
Since shell-script-completions now runs the script asynchronously
and unconditionally, there is no use for the CompletionFlags::Fast
anymore which means we can remove that type altogether.
|
|
Share most logic with shell-script-candidates. Now that we do not
block we can run the completion script implicitely instead of waiting
for an explicit completion request with <tab>.
Fixes #5245
|
|
hex(...) function
|
|
9275d96 introduces a use of stdin as a function parameter name, but POSIX
allows stdin to be a macro, which will conflict with this. This breaks
the build on musl systems.
Rename in the same way as the previous fix for this in c7d887d.
|
|
|
|
Use an empty Optional to show that resolution failed and just do not
do anything in the mouse event handler in that case.
|
|
Staging/unstaging/reverting (parts of) the current buffer's file can
be a common use case.
Today "git apply" can do that based on a selection within a diff.
When the selection is on uncommitted content, we can probably assume
that the intent is to use the part of the selection that overlaps
with the +-side of "git diff" (or "git diff --cached" for
"git apply --cached").
Make "git apply" treat selections as content if the buffile is
tracked by Git. This differentiator is not perfect but I don't know
why anyone would want to use the existing "git apply" semantics on
a tracked file. Maybe we should pick a different name.
This feature couples well with "git show-diff", which shows all
lines with unstaged changes (in future it should probably show staged
changes as well).
Whereas on diffs, "git apply" stages the entire hunk if the selection
contains no newline, this does not happen when operating on content.
I didn't yet try implementing that. I guess the hunks are not as
explicit here.
Closes #5225
|
|
Use a separate option from terminal_set_title for simplicity.
Fixes #2217
Closes #4265
|
|
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.
|
|
Looks like we've been over eager with removing unused includes and
did not realize they were only unused in optimized builds.
|
|
|
|
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.
|
|
When typing <s-ret>, XTerm sends
\e[27;2;13~
Only when formatOtherKeys is set to 1 by the user, XTerm will send
an equivalent CSI u encoding.
|
|
Fixes numlock input on Alacritty.
Closes #5214
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Add cursor coordinate parameters, and fix encoding to match the
new one.
|
|
|
|
|
|
|
|
|
|
Lots of code includes buffer_utils.hh just for write_to_debug_buffer
which pulls many unnecessary dependencies. Reorganise to reduce
compile times.
|
|
Move more code into the implementation files to reduce the amount
of code pulled by headers.
|
|
|
|
Split it to avoid pulling all string_utils dependencies for just
format.
|
|
|
|
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).
|
|
|
|
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.
|
|
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>.
|
|
|
|
This is all internal code that should not be exposed.
|
|
|