From 9b953c36e09e099fb19566b34212b54e5dbf6248 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Wed, 21 May 2025 20:58:39 -0400 Subject: [PATCH] AutoYADM commit: 2025-05-21 20:58:39 --- .config/fish/functions/kak-session.fish | 4 ++-- .config/kak/autoload/title.kak | 22 ++++++++++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.config/fish/functions/kak-session.fish b/.config/fish/functions/kak-session.fish index f869092f..3fca4023 100644 --- a/.config/fish/functions/kak-session.fish +++ b/.config/fish/functions/kak-session.fish @@ -86,7 +86,7 @@ function kak-session -w kak --description "kakoune where sessions are derived fr cat $fifo >/dev/null command rm -r "$fifo_dir" - command kak -c "$session_id" $flags $files + command kak -c "$session_id" -e 'try %{ delete-buffer *scratch*; bar-buflist; echo }' $flags $files else command kak -s "$session_id" -e "cd %[$kakroot]" $flags $files end @@ -114,7 +114,7 @@ function kak-session -w kak --description "kakoune where sessions are derived fr setsid kak -d -s "$session_id" -E "cd %[$git_dir]; echo -to-file $fifo ready" & cat $fifo >/dev/null command rm -r "$fifo_dir" - command kak -c "$session_id" -e 'try %{ delete-buffer *scratch* }' $flags $files + command kak -c "$session_id" -e 'try %{ delete-buffer *scratch*; bar-buflist; echo }' $flags $files else command kak -s "$session_id" -e "cd %[$git_dir]" $flags $files end diff --git a/.config/kak/autoload/title.kak b/.config/kak/autoload/title.kak index d116d0f6..d2e91b61 100644 --- a/.config/kak/autoload/title.kak +++ b/.config/kak/autoload/title.kak @@ -1,3 +1,21 @@ +declare-option -docstring %{ + Format string passed to printf for the bufferlist. + It should be set in the global scope. + + It receives two string arguments, where the first is the buffer index, + and the second is the buffer name. + + Default: '[%s %s]' +} str bar_active_fmt '[%s %s]' +declare-option -docstring %{ + Format string passed to printf for the bufferlist. + It should be set in the global scope. + + It receives two string arguments, where the first is the buffer index, + and the second is the buffer name. + + Default: '%s %s' +} str bar_inactive_fmt '%s %s' define-command -hidden bar-buflist %{ evaluate-commands %sh{ list='' @@ -7,9 +25,9 @@ define-command -hidden bar-buflist %{ fi index=$(($index + 1)) if [ "$buf" = "$kak_bufname" ]; then - cur=$(printf '[%s %s]' "$index" "$buf") + cur=$(printf "$kak_opt_bar_active_fmt" "$index" "$buf") else - cur=$(printf '%s %s' "$index" "$buf") + cur=$(printf "$kak_opt_bar_inactive_fmt" "$index" "$buf") fi list="$list $cur" done <<<$(printf '%s\n' "$kak_buflist" | perl -nE 'say for /(\*[^*]+\*|\S+)/g')