summaryrefslogtreecommitdiff
path: root/src/main.cc
AgeCommit message (Collapse)Author
2025-07-08Replace std::unique_ptr with a custom implementationMaxime Coste
<memory> is a costly header we can avoid by just implementing UniquePtr ourselves, which is a pretty straightforward in modern C++, this saves around 10% of the compilation time here.
2025-07-08Merge remote-tracking branch 'pjungkamp/history'Maxime Coste
2025-07-05Introduce `history_since_<id>` value expansionPhilipp Jungkamp
The `history_since_<id>` value expansion allows incremental parsing of a buffer's history. declare-option int my_last_history_id define-command my-process-history ... # process the initial buffer history my-process-history %val{bufname} 0 %val{history} set-option buffer my_last_history_id 0 # only process new history changes on idle hook buffer NormalIdle %{ evaluate-commands %exp{ my-process-history \ %%val{bufname} \ %%opt{my_last_history_id} \ %%val{history_since_%opt{my_last_history_id}} } set-option buffer my_last_history_id %val{history_id} }
2025-07-03Rework startup messageMaxime Coste
Link to `:doc changelog` in the title and link to startup-info there so that this information stays visible even if the changelog overflows the info box. Use format support for 0 padding instead of custom code
2025-07-02Only keep the last 3 versions in startup infoMaxime Coste
We have this information in the changelog and its unlikely users will read past the third entry. Fixes #5352
2025-06-28Revert "chore: remove terminal option"Yukai Huang
This reverts commit 549a5d2c223d422390795741537b150b492a3935.
2025-06-27chore: remove terminal optionYukai Huang
2025-06-24feat(terminal): add option for native terminal cursor renderingYukai Huang
2025-06-03Kakoune 2025.06.03Maxime Coste
2025-03-24Default InputHandler::handle_key() synthesized argumentJohannes Altmanninger
We have only one place where we handle actual keys typed by the user.
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
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-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-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-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
2024-10-22Fork server to background on <c-z> if session is daemonizedMaxime Coste
Fixes #4957
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-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-16include headers cleanupAdrià Arrufat
2024-08-15Add double underline in main version notesAdrià Arrufat
2024-08-14Merge remote-tracking branch 'lenormf/fix-3972'Maxime 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-07-22Handle word completion when recording macrosMaxime Coste
Make last insert and macro recording closer together, paving the way towards moving last insert to a register. Use a FunctionRef for insert completer key insertion support.
2024-06-24Add EnterDirectory hookPhilipp Jungkamp
This hook runs on `change-directory` and is also emitted just before KakBegin after kakrc has been sourced.
2024-06-07Also check shell parameters for kak_* referencesMaxime Coste
This makes it easier to pass shell fragments as arguments so that %sh{ eval "$@" } just works even if arguments refer to Kakoune's vars.
2024-05-18Kakoune 2024.05.18Maxime Coste
2024-05-09Kakoune 2024.05.09Maxime Coste
2024-02-10Merge remote-tracking branch 'krobelus/changelog'Maxime Coste
2024-02-05Changelog entries for new blame featuresJohannes Altmanninger
2024-01-30Support -after switch for flag-lines highlighterMaxime Coste
2023-12-16Update changelogJohannes Altmanninger
2023-12-02Merge remote-tracking branch 'sidkshatriya/escape-curly-bracket'Maxime Coste
2023-11-17Update changelogJohannes Altmanninger
2023-11-17changelog: escape `{` as `\\{` otherwise '%val{window_range}' appears as ↵Sidharth Kshatriya
'%val' in version notes startup splash
2023-11-14Make shell-script-candidates completer run in the backgroundMaxime Coste
Read output from the script as it comes and update the candidate list progressively. Disable updating of the list when a completion has been explicitely selected.
2023-11-13Change window_range to emit each element as a separate stringMaxime Coste
2023-11-03Use explicit target types for gather calls to bypass clang regressionMaxime Coste
Since clang-16 there has been a regression in the P0522R0 support. (Bug report at https://github.com/llvm/llvm-project/issue/63281) Closes #4892
2023-09-26Add a daemonize-session command and refactor local client handlingMaxime Coste
Make it possible to move the current session to a daemon one after the fact, which is useful to ensure the session state survives client disconnecting, for example when working from ssh.
2023-09-22Fix quoting of arguments to kak -c SESSIONChris Webb
Filename arguments to kak -c SESSION are passed to the remote sessions as commands like edit 'FILENAME'; but single-quotes in FILENAME are incorrectly escaped as \' instead of being doubled-up. Fix this so kak -c SESSION "foo'bar" becomes edit 'foo''bar'; instead of edit 'foo\'bar'; Reported by @FlyingWombat in https://github.com/mawww/kakoune/issues/4980
2023-09-08Use last display setup instead of recomputing for window_rangeMaxime Coste
Fixes #4964
2023-08-14Change `+` command not to duplicate identical selections more than onceMaxime Coste
The current exponential behaviour does not seem that useful, it seems more predictible that pressing `+` twice would end up with 3 copies of the original selections instead of 4. Fixes #4533
2023-08-13Add a ProfileScope helper class to replace most profiling usesMaxime Coste