From 3cb87ea64d9fc9653756a22794b7cc5caf38476f Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Sat, 14 Jun 2025 04:18:00 -0400 Subject: [PATCH] AutoYADM commit: 2025-06-14 04:18:00 --- .config/kak/autoload/ltex-dict.kak | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.config/kak/autoload/ltex-dict.kak b/.config/kak/autoload/ltex-dict.kak index a6565290..813d8310 100644 --- a/.config/kak/autoload/ltex-dict.kak +++ b/.config/kak/autoload/ltex-dict.kak @@ -3,15 +3,20 @@ provide-module ltex-dict %~ declare-option str ltex_dict_path %exp{%val{config}/ltex-dict.txt} define-command ltex-dict-set %{ set-option buffer lsp_servers %sh{ + echo >/tmp/test.txt list="$(cat "$kak_opt_ltex_dict_path" | kak -f '%Zbi\"a\"zr,x_i[a]')" + notify-send "$list" echo "$kak_opt_lsp_servers" | sed "/^\s*dictionary =/ s/\[\]/$list/g" + echo "$kak_opt_lsp_servers" | sed "/^\s*dictionary =/ s/\[\]/REPLACED/g" >/tmp/test.txt } } define-command ltex-add %{ - evaluate-commands %sh{ + execute-keys -draft %sh{ if [ "$kak_selection_length" = 1 ]; then - printf 'execute-keys bw_tee -a /tmp/test.txt' - + printf 'bw_{ cat; echo; } | tee -a %s\n' "$kak_opt_ltex_dict_path" + else + printf '{ cat; echo; } | tee -a %s\n' "$kak_opt_ltex_dict_path" + fi } }