summaryrefslogtreecommitdiff
path: root/rc
AgeCommit message (Collapse)Author
2025-01-22Merge remote-tracking branch 'thacuber2a03/master' into HEADMaxime Coste
2025-01-03rc/filetype: add wren.kakThaCuber
2025-01-03rc make: support multiline error patternygrek
2024-12-15typst: fix comment_line and comment_block* options for typstyemou
2024-12-09Use makecmd from calling context againJohannes Altmanninger
Commit 888b23ffa (Fix grep arguments being evaluated in toolsclient context, 2024-11-27) had good intentions but it broke commit ef18d3cbf (rc make/grep: evaluate makecmd in calling context, use eval semantics again, 2024-07-31), causing makecmd to be evaluated in toolsclient again. Fix that by passing makecmd via a register, like grep.kak does.
2024-11-27Fix grep arguments being evaluated in toolsclient contextJohannes Altmanninger
Commit ef18d3cbf (rc make/grep: evaluate makecmd in calling context, use eval semantics again, 2024-07-31) fixed a regression in make.kak but didn't bother to fix a similar regression in grep.kak: evaluation of both %opt{grepcmd} and %val{selection} were moved to the toolsclient context. Move them back to the calling context. While at it, get rid of the double evaluation of makecmd, for consistency with grepcmd, and in case makecmd contains unbalanced braces.
2024-11-13Add filetype for ember js .gjs and .gts filesJonas Cosandey
2024-11-12grep.kak: make it possible to search for patterns starting with '-'Olivier Perret
2024-10-22Merge remote-tracking branch 'yoshiyoshyosh/spell'Maxime Coste
2024-10-22rc ctags: remove obsolete -markup switchJohannes Altmanninger
menu no longer supports the -markup switch since 1f1152983 (rc tools menu: replace menu builtin with a prompt-based implementation, 2023-11-20). That commit removed all markup that ctags passes to menu but didn't bother to remove -markup switch (because it's ignored). Let's remove the switch to avoid the need for escaping "{". Closes #5244
2024-09-22Rework spell-next and add spell-prev commandyosh
Take use of the fact that awk's FS already uses regex for splitting to eliminate the usage of sub() within the actual awk program.
2024-09-18rc git: don't require client in git show-diffJohannes Altmanninger
This fails because the new logic wrongly assumes the presence of a client: hook global WinCreate /.* 'git show-diff' The "diff" process hangs because we never write to ${kak_response_fifo}. After a "pkill diff", the *debug* buffer shows error while waiting for shell: 1:1: 'evaluate-commands': 3:13: 'execute-keys': no such client: '-draft' shell stderr: <<< The client argument is completely unnecessary since we always want to use the calling context's buffer anyway. Remove it. Note that we can probably further simplify this by using "write" instead of a shell process. I'll send that patch along a few other error handling improvements later. Closes #5235
2024-09-18rc git: fix show-diff and apply for BSD sedJohannes Altmanninger
2024-09-16Merge remote-tracking branch 'sjjf/sql_filetype_misdetection'Maxime Coste
2024-09-16Fix "git blame" inside "git blame-jump" diff buffersJohannes Altmanninger
I used to use a patch that removes cd_bufdir so I didn't notice this being broken for *git* buffers.
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-16patch-range.pl: extract peculiaritiesJohannes Altmanninger
We pipe the output of the patch program to stderr (to have it show up in *debug*) and print to stdout the remaining diff (the part of the diff that was not passed to patch). The next patch wants to use this script in a different way, so move these decisions up.
2024-09-16diff-parse.pl: don't force error message into registerJohannes Altmanninger
A following patch wants to use this script without wrapping it in an "evaluate-commands -save-regs e %{ ... }", so simply print the raw error message and set the register to the caller. This interface is a bit weird because the error is printed quoted but for now that just makes things a bit more convenient.
2024-09-16rc git: show-diff to honor unsaved buffer modificationsJohannes Altmanninger
If a file has unsaved modifications, then the show-diff flags below such modifications will be wrong. Fix this by using the current buffer contents, just like the git blame integration does. This might make it a bit slower, I haven't tested that.
2024-09-16rc git: rationalize blame fifo usageJohannes Altmanninger
We call git blame a. asynchronously in ":git blame" b. synchronously in ":git blame-jump" In both cases we 1. create a fifo 2. buffer the file contents in shell memory 3. print to the fifo 4. run git blame and remove the fifo For the synchronous case the buffering and custom fifo is not necessary; use ${kak_response_fifo} instead. For the asynchronous case we do need a buffer that outlives the enclosing %sh{} block. Buffering in shell memory can be somewhat slow for large files. Let's use a temporary file instead.
2024-09-16rc git: simplify git diff invocationJohannes Altmanninger
If stdout is not a TTY, Git never calls a pager, so this is unnecessary.
2024-09-16rc filetype diff: diff-jump to use location at main selection, not the last oneJohannes Altmanninger
The jump command does the same.
2024-09-06Add new Zig builtinsAdrià Arrufat
2024-08-31Match against .sql extension, not sql suffix.Simon Fowler
The SQL filetype detection currently matches against a 'sql' suffix on the filename, which incorrectly matches a filename like 'run-psql'. Instead, explicitly match against a '.sql' suffix.
2024-08-09Fixed highlighter marking everything as ruby string in ERB filesEric
2024-08-06Add gleam language supportThomas Teixeira
2024-08-05rc make/grep: evaluate makecmd in calling context, use eval semantics againJohannes Altmanninger
I configured :make to use a special makecmd for files called test.cpp. hook global BufCreate .*/test.cpp %{ set-option buffer makecmd "g++ %val{buffile} && ./a.out" } Commit c93cb5c4d (Add a `fifo` helper command and refactor `make` and `grep` to use it, 2024-06-07) made :make evaluate makecmd in the toolsclient context instead of the calling context, so my buffer-local override no longer applies. I'm not sure if this is something we want to guarantee but it doesn't seem unreasonable, and we can fix it a no cost I think. Additionally, it changed eval "${kak_opt_makecmd}" "$@"; to $kak_opt_makecmd "$@" meaning that the "&&" in my makecmd will no longer be evaluated. Instead it will be passed as argument to g++, effectively g++ %val{buffile} '&&' ./a.out which I don't think is a reasonable expectation (unless we change makecmd to be str-list options). Essentially, the above only applies word splitting to makecmd; it seems simpler and less surprising to treat them as raw shell commands. Expand makecmd in the calling client again, and insert it verbatim into the shell script. grep hasn't needed it so far but keep it consistent.
2024-07-17php: improve heredocWillow Barraco
Support nowdoc, and make ';' optional
2024-07-09rc: filetype: sh.kak: add some more zsh files for auto coloring on openchelovechishko
2024-06-27erlang: Fix the comment_line configurationDaniel Gorin
Erlang comments start with `%`. This is correctly highlighted but the comment-line/comment-block commands don't work correctly.
2024-06-26Fix corner case in passin arguments to grep and makeMaxime Coste
2024-06-23Merge remote-tracking branch 'stacyharper/elixir-heex'Maxime Coste
2024-06-22Add a -script switch to the fifo to cater for grep/make use casesMaxime Coste
Avoid the brittle `exit; %arg{@}` trick
2024-06-19elixir: detect heex additionaly to leexWillow Barraco
2024-06-15Add perf-annotate highlighting to perf.kakMaxime Coste
2024-06-11Tweak python block command test location and remove wall of textMaxime Coste
We do not typically go into lengthy explanation of the code in the support scripts. This would have a performance impact (as comments are not trimmed in advance) and feels out of place.
2024-06-07Support paragraph breaks in python block comments.Simon Fowler
The current python filetype module treats a single empty comment line (typically created by hitting enter twice while in a block comment) as the end of a block comment, deleting the empty comment and ending comment prefix copying. This runs contrary to PEP8, which explicitly allows for paragraphs in block comments, with an empty comment as the paragraph separator. This change implements support for using a single empty comment as a paragraph separator, with two consecutive empty comments being treated as the end of the block comment; both empty comment lines are deleted and comment prefix copying is ended.
2024-06-07Add a `fifo` helper command and refactor `make` and `grep` to use itMaxime Coste
Running arbitrary commands in a fifo is very useful in its own right and factoring out the common pattern is a nice added cleanup.
2024-06-06Add rc/filetype/perf.kak for perf-report highlightMaxime Coste
2024-05-29Merge remote-tracking branch 'QiBaobin/git-completer'Maxime Coste
2024-05-29Merge remote-tracking branch 'm-kru/typst'Maxime Coste
2024-05-26tcl: Highlight variables as variables, not as valuesMichał Kruszewski
2024-05-23typst: Add typst.kak for typst markup highlightingMichał Kruszewski
2024-05-12Fix another case where git tests were hangingMaxime Coste
2024-04-27Make grep-(next|prev)-match use the latest buffer matching \*grep(-.*)\*Maxime Coste
2024-04-24add `add` to the git completerBob Qi
2024-04-20Merge remote-tracking branch 'm-kru/rust'Maxime Coste
2024-04-16rust: Highlight char and byte literals as valuesMichał Kruszewski
Char and byte literals are values. There is no point in using fixed colors for them.
2024-04-12Introduce "local" scope in evaluate-commandsMaxime Coste
When using `eval` a new scope named 'local' gets pushed for the whole evaluation, this makes it possible to temporarily set an option/hook/alias... Local scopes nest so nested evals do work as expected. Remove the now trivial with-option command
2024-04-12Make removing an unknown highlighter an errorMaxime Coste
Fail instead of silently doing nothing, this makes it easier to toggle highlighters using a try/catch