summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2025-05-11Update GDB pretty printer following SSO layout changeJohannes Altmanninger
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.
2025-04-15Disable keymaps when playing macroSeerLite
Macros are already recorded with keymaps resolved, so there's no need to resolve them again.
2025-04-02Reduce include creepMaxime Coste
2025-04-02Tweak ranked match behaviour to consider the number of full wordsMaxime Coste
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.
2025-03-26Remove unused variableMaxime Coste
2025-03-26Make sure captures are taken into account when comparing selectionsMaxime Coste
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.
2025-03-25Bump build to c++23Maxime Coste
2025-03-24Fix prompt history recording when using mapped keysJohannes Altmanninger
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.
2025-03-24Default InputHandler::handle_key() synthesized argumentJohannes Altmanninger
We have only one place where we handle actual keys typed by the user.
2025-03-22Improve info box clearing behaviourMaxime Coste
Schedule clearing of the info box from normal mode even if mode was disabled, clear on insert idle as well. Fixes #5300
2025-03-22Merge remote-tracking branch 'lenormf/fix-user-mode-lock'Maxime Coste
2025-02-26Merge remote-tracking branch 'dontlaugh/master' into HEADMaxime Coste
2025-02-20Try to fix MacOS compilationMaxime Coste
2025-02-19Slight style tweaksMaxime Coste
2025-02-19Move command/filename completion logic to completion.ccMaxime Coste
Refactor list_files to use a callback instead of returning a vector, file.cc/hh should not know about completion logic.
2025-02-19Cleanup file.cc/hh dependenciesMaxime Coste
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.
2025-02-16Revert "WIP history register"Maxime Coste
This is not finished yet, and pushed by accident, again... This reverts commit 22b461c3a0b22dd4501943230f0774c34f0b4b35.
2025-02-10WIP history registerMaxime Coste
2025-02-05Make Control modifier quote inserted registers in prompt modeMaxime Coste
It is often usefull to quote the inserted register, like when doing `:grep <c-r>/`, or when pulling selected filenames with `<c-r><a-.>`.
2025-02-04Change kak_expect_throw macro to use alignofColeman McFarland
2025-02-04Revert "WIP linked list shared strings"Maxime Coste
This got pushed by accident This reverts commit 2856b99e0914cc7a659977f2b33308cb5b4c9bb7.
2025-02-04Revert "Use uint64_t for regex step"Maxime Coste
This got pushed by accident This reverts commit d92496449d0c9655253ad16363685bb8446dc582.
2025-02-02Change kak_assert macro to silence a clang-tidy warningColeman McFarland
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.
2025-01-22Use uint64_t for regex stepMaxime Coste
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.
2025-01-22WIP linked list shared stringsMaxime Coste
2024-12-25Merge remote-tracking branch 'enricozb/enricozb/daemon-stdin' into HEADMaxime Coste
2024-12-23fix missing argument to create_fifo_bufferEnrico Zandomeni Borba
2024-12-23cleanup mergeEnrico Zandomeni Borba
2024-12-23Merge branch 'master' into enricozb/daemon-stdinEnrico Borba
2024-12-23create *stdin* buffer even when daemonEnrico Zandomeni Borba
2024-12-10Code style tweak in regex_implMaxime Coste
2024-12-09Rework split between exec and exec_program methodMaxime Coste
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.
2024-12-09Print elapsed time when blocked on opening file for writingJohannes Altmanninger
Extract the logic for "waiting for shell to finish" and reuse it for potentially blocking calls to open() that use the O_WRONLY flags.
2024-12-09Allow cancelling "write fifo" with <c-g>Johannes Altmanninger
Just like "echo -to-file fifo".
2024-12-09Tweak inlining around thread stack push/pullsMaxime Coste
Ensure push/pulls operations are inlined except for the uncommon grow.
2024-12-05Fix parameter passing in find_next_startMaxime Coste
2024-12-05Split utf8::read_codepoint between single byte and multibyte codeMaxime Coste
Make read_codepoint_multibyte noinline so that the common case single byte case gets inlined.
2024-12-04Use default comparison impl for LineAndColumn and StronglyTypedNumberMaxime Coste
This is a bit simpler and should leave more leeway to the optimizer to detect it can compare the whole struct.
2024-12-04Various small code simplifications/tweaks in ThreadedRegexVMMaxime Coste
2024-12-03Compact BufferIterator to avoid paddingMaxime Coste
2024-12-03Do not store buffer pointer in BufferIteratorMaxime Coste
This makes BufferIterator smaller and trivially move/copyable
2024-12-01Fix extra newline inserted into stdin buffersJohannes Altmanninger
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.
2024-12-01Scrolling BufReadFifo to not not report final empty lineJohannes Altmanninger
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.
2024-12-01Add specific start desc optimization for single possible start byteMaxime Coste
Use tighter codegen for that pretty common use case.
2024-11-30Cache buffer lines ArrayView in BufferIteratorMaxime Coste
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.
2024-11-28Raise the regex idle function call period to every 16M codepointMaxime Coste
2024-11-28Add back option to scroll in stdin buffersJohannes Altmanninger
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.
2024-11-28Fix BufReadFifo overlapping range on partial lineJohannes Altmanninger
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
2024-11-28Fix overlapping range passed to BufReadFifo in non-scrolling fifosJohannes Altmanninger
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
2024-11-22Take a timeout argument in EventManager::handle_next_eventsMaxime Coste
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