summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2024-11-16Run urgent event loop when blocking on opening a file for writingMaxime Coste
This makes <c-g> cancel the writing operation if we block on trying to open a fifo with no reader. Fixes #5256
2024-11-12Fail rename-session instead of creating overlong socket pathsJohannes Altmanninger
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.
2024-11-04Highlight all atoms for the line regardless of has_buffer_rangeMaxime Coste
This changes the behaviour with say line numbers and other line flags, but can be opted out by using final faces Fixes #5253
2024-11-04Fix backward regex search ending in DOTALLJohannes Altmanninger
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.
2024-10-28Only check for ascii horizontal blanks during command parsingMaxime Coste
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
2024-10-22Fork server to background on <c-z> if session is daemonizedMaxime Coste
Fixes #4957
2024-10-22Remove now unused CompletionFlagsMaxime Coste
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.
2024-10-22Run shell-script-completions asynchronouslyMaxime Coste
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
2024-09-19add header file #incldue "format.hh" to fix building error about missing ↵Passw
hex(...) function
2024-09-17Avoid stdin as a function parameter nameChris Webb
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.
2024-09-16Rename Window::display_position to display_coordMaxime Coste
2024-09-16Do not return beginning of buffer whenever display to buffer coord failsMaxime Coste
Use an empty Optional to show that resolution failed and just do not do anything in the mouse event handler in that case.
2024-09-16rc git: teach "git apply" to work on content, not just diffsJohannes Altmanninger
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
2024-09-08Add terminal_title terminal ui_option to control the titleMaxime Coste
Use a separate option from terminal_set_title for simplicity. Fixes #2217 Closes #4265
2024-09-02Explicitely call try_accept on InsertCompleterMaxime Coste
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>.
2024-09-02Fix <c-r> use-after-free InsertCompletionHide touches used registerJohannes Altmanninger
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
2024-08-26Do not gather full input data in a single string when pipingMaxime Coste
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.
2024-08-26Fix includes for debug buildMaxime Coste
Looks like we've been over eager with removing unused includes and did not realize they were only unused in optimized builds.
2024-08-26Merge remote-tracking branch 'arrufat/update-double-underline-main'Maxime Coste
2024-08-24Add back <cwchar> for wcwidth in src/unicode.hhChris Webb
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.
2024-08-19Merge remote-tracking branch 'arrufat/includes-cleanup'Maxime Coste
2024-08-19Don't interpret the \n input byte as <ret>Johannes Altmanninger
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.
2024-08-19Decode XTerm's formatOtherKeys=0 encodingJohannes Altmanninger
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.
2024-08-19Decode kitty keyboard protocol's numlock keysJohannes Altmanninger
Fixes numlock input on Alacritty. Closes #5214
2024-08-16include headers cleanupAdrià Arrufat
2024-08-15Add double underline in main version notesAdrià Arrufat
2024-08-15Remove some more unnecessary includesMaxime Coste
2024-08-15Remove unused ConstexprVector and rename constexpr_utils.hh to array.hhMaxime Coste
2024-08-14Remove unused wrap_to and reduce string_utils headersMaxime Coste
2024-08-14Remove tuple use from ranges.hhMaxime Coste
2024-08-14Reduce number of included headersMaxime Coste
2024-08-14Merge remote-tracking branch 'lenormf/fix-3972'Maxime Coste
2024-08-14Fix json-ui scroll supportMaxime Coste
Add cursor coordinate parameters, and fix encoding to match the new one.
2024-08-14Merge remote-tracking branch 'enricozb/enricozb/scroll-coordinates'Maxime Coste
2024-08-14Merge remote-tracking branch 'arrufat/support-double-underline'Maxime Coste
2024-08-14More include fixesMaxime Coste
2024-08-14Add missing include for non libstdc++ buildsMaxime Coste
2024-08-12Move debug utils to debug.hh/debug.ccMaxime Coste
Lots of code includes buffer_utils.hh just for write_to_debug_buffer which pulls many unnecessary dependencies. Reorganise to reduce compile times.
2024-08-12Reduce headers dependency graphMaxime Coste
Move more code into the implementation files to reduce the amount of code pulled by headers.
2024-08-12Reduce exposed headers from context.hhMaxime Coste
2024-08-12Extract format implementation to its own fileMaxime Coste
Split it to avoid pulling all string_utils dependencies for just format.
2024-08-12Remove void_t and use requires insteadMaxime Coste
2024-08-12Move most info/status clear logic to clientMaxime Coste
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.
2024-08-08Delay NormalMode clearing of status line and info box to next idleMaxime Coste
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).
2024-08-06fix mouse scrollingEnrico Zandomeni Borba
2024-08-04fix mouse coord underflowEnrico Zandomeni Borba
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.
2024-08-04add scroll coordinatesEnrico Zandomeni Borba
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>.
2024-08-04Add support for double underlineAdrià Arrufat
2024-08-04Move most code in regex_impl inside the anonymous namespaceMaxime Coste
This is all internal code that should not be exposed.
2024-07-27Reduce templatization further to reduce binary sizeMaxime Coste