| Age | Commit message (Collapse) | Author |
|
Commit 2754e27cf (Increase SSO from 22 to 23 chars., 2024-06-07) changed
they layout of SSO-strings. Specifically, is_long() no longer takes a bit
away from the size field.
Update the GDB pretty printer accordingly, making it work with small strings
again.
|
|
Macros are already recorded with keymaps resolved, so there's
no need to resolve them again.
|
|
|
|
Tracking the number of query words that appear as full words in the
candidate seems to fix a few cases where the existing fuzzy matching
algorithm was not great.
I have been running with this for a while and did not notice any
annoyances, the whole RankedMatch code probably deserves more attention
but this seems to go in the right direction.
|
|
|
|
sel1 == sel2 was using BasicSelection::operator==, ignoring captures,
which led to selection history deciding that selection did not change
in some cases where only the captures had been updated and for the
new selection not to be properly applied, leading to missing capture.
|
|
|
|
Commit e3122ab2c (Refactor prompt history handling, 2023-07-05) was a nice
simplification but it breaks a rare edge case. It suppresses history
recording if all keys the prompt receives were synthesized. That's not
quite the right criteria:
it means that if prompt is created, edited and and executed, all via mapped
keys, we fail to add to history.
The criteria should rather be something like "if all keys the prompt receives
came from synthesized events".
Make it so. This allows us to get rid of the "noninteractive" nested bool
that was only used for disabling history.
|
|
We have only one place where we handle actual keys typed by the user.
|
|
Schedule clearing of the info box from normal mode even if mode
was disabled, clear on insert idle as well.
Fixes #5300
|
|
|
|
|
|
|
|
|
|
Refactor list_files to use a callback instead of returning a vector,
file.cc/hh should not know about completion logic.
|
|
file.cc/hh should not know about Context, Buffer, etc... It should
be a pretty low level set of helper functions. Move buffer related
functions to buffer_utils and extract busy indicators to callers.
|
|
This is not finished yet, and pushed by accident, again...
This reverts commit 22b461c3a0b22dd4501943230f0774c34f0b4b35.
|
|
|
|
It is often usefull to quote the inserted register, like when doing
`:grep <c-r>/`, or when pulling selected filenames with `<c-r><a-.>`.
|
|
|
|
This got pushed by accident
This reverts commit 2856b99e0914cc7a659977f2b33308cb5b4c9bb7.
|
|
This got pushed by accident
This reverts commit d92496449d0c9655253ad16363685bb8446dc582.
|
|
When KAK_DEBUG is false (release mode), clang tidy emits a
warning when we pass a pointer to kak_assert. It's mad about
passing a pointer to `sizeof`.
We can avoid this warning by using `alignof(decltype(...))`. It
will still type-check the expression.
|
|
Its unclear that maintaining a small instruction
size outweigh the cost of handling wrapping of
the current_step every 64K codepoints, this makes
the code simpler.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Split last iteration out of the loop so that optimizer can elide
most comparisons between pos and config.end as its always different
in the loop and equal at last call.
|
|
Extract the logic for "waiting for shell to finish" and reuse it for
potentially blocking calls to open() that use the O_WRONLY flags.
|
|
Just like "echo -to-file fifo".
|
|
Ensure push/pulls operations are inlined except for the uncommon
grow.
|
|
|
|
Make read_codepoint_multibyte noinline so that the common case single
byte case gets inlined.
|
|
This is a bit simpler and should leave more leeway to the optimizer
to detect it can compare the whole struct.
|
|
|
|
|
|
This makes BufferIterator smaller and trivially move/copyable
|
|
Commit c3b01a3c9 (Add back option to scroll in stdin buffers,
2024-11-27) missed the case where the initial read
from stdin had no trailing newline:
for i in $(seq 50); do printf .; sleep .1; done | kak
After the first read, we transplant the initial newline to end.
This creates an extra newline because we already added a fake newline
to uphold buffer invariants. Fix that.
|
|
Whereas nonscrolling fifos generally[^1] append to the very end of
the buffer, scrolling fifos generally insert *before* the final
empty line.
This means that every single BufReadFifo hook in a scrolling fifo will
report an additional newline. This is clearly wrong. Even reporting
it only once would be wrong, because the newline is not added by a
fifo read.
This behavior has always existed for "edit -scroll -fifo" buffers.
For stdin buffers, it was re-introduced in c3b01a3c9 (Add back option
to scroll in stdin buffers, 2024-11-27).
Fix this by ending the reported range before the final empty line.
Handle one edge case: if the inserted range did not end with a
newline, the final empty line collapses into the previous line.
In this case we already don't report the newline because it's declared
"artificially-added" by 658915086 (Fix BufReadFifo overlapping range
on partial line, 2024-11-23).
This fixes the problem described at
https://github.com/mawww/kakoune/issues/5255#issuecomment-2505650511
Tests are copied verbatim from the no-scroll cases (not yet sure how
to share logic / parameterize a test in a nice way):
$ diff -ur test/commands/fifo-read-ranges{,-scroll}
-edit -fifo fifo *fifo*
+edit -fifo fifo -scroll *fifo*
$ diff -ur test/commands/fifo-read-ranges-noeol{,-scroll}
-edit -fifo fifo *fifo*
+edit -fifo fifo -scroll *fifo*
[^1]: unless the very last character is a fake newline (except for
the first read, to not scroll) which we already don't report.
|
|
Use tighter codegen for that pretty common use case.
|
|
The extra indirection of going through the buffer can be costly as
the compiler does not know the buffer is not supposed to be mutated
during iteration, so it has to actually reload the values which adds
memory accesses in the Buffer instance which can be costly in say
regex searches where memory access tends to dominate performance.
Storing this in the BufferIterator lets the compiler put this
info in registers and not reload it.
|
|
|
|
Commit 582c3c56b (Do not add trailing newline to non-scrolling fifo
buffers, 2024-01-28) completely forgot about stdin buffers,
breaking the ability to make them scrolling via "ge".
For example
while sleep 1; do
seq $LINES
date
done | kak
Let's fix that by adding the trailing newline back for stdin buffers.
Unlike "edit -scroll", don't scroll until the user explicitly moves
the cursor.
|
|
As reported in [1], when reading from a fifo a buffer that is not
newline-terminated, we add a newline automatically, and include that
in the range reported to BufReadFifo.
I'm not 100% sure if this is really wrong but since the typical
consumer of BufReadFifo does something like
select %val{hook_param}
exec |grep foo<ret>
it seems safe to remove this newline; doing so means that
1. "grep foo" will no longer see a newline in stdin, which
seems good.
2. Kakoune will strip a trailing newline from the command output,
since the input didn't have one. So the input is the same.
Let's remove any artificially-added newline from the hook parameter.
[1]: https://lists.sr.ht/~mawww/kakoune/%3CZzXjfXnETd2gbeXa@thristian.org%3E
|
|
On the first read from a nonscrolling fifo, we insert after the buffer
contents (which is just "\n"), and later delete the redundant newline
(582c3c56b (Do not add trailing newline to non-scrolling fifo buffers,
2024-01-28)). This deletion invalidates inserted ranges passed to
BufReadFifo. Fix that.
The test uses another fifo to pass ranges. I guess it could use
"ui_out -until" as well but this seems simpler. The test script needs
a fd but 3 and 4 are already taken so use 5. I didn't find a portable
way to check if it's already taken.
Fixes #5255
|
|
When provided, this gives the maximal time to wait before exiting
handle_next_events. If not given handle_next_events will block, this
provides a more flexible approach than the previous "block" boolean.
Use this to wait for a millisecond between each try to open a fifo
for writing.
Fixes the 100% cpu usage discussed in github on commit
e74a3ac6a3bad1b74af71aa0bfdacb41ffcb7355
|