Fix texlab forward search

This commit is contained in:
Natsu Kagami 2024-06-23 17:40:07 +02:00
parent ea7e32973a
commit c59b47c1ce
Signed by: nki
GPG key ID: 55A032EB38B49ADB
3 changed files with 5 additions and 15 deletions

View file

@ -153,7 +153,7 @@ in
} else } else
{ {
executable = "${pkgs.zathura}/bin/zathura"; executable = "${pkgs.zathura}/bin/zathura";
args = [ "--synctex-forward" "%l:1:%f" "%p" "-x" "/home/nki/.bin/kaktex jump %{input} %{line}" ]; args = [ "--synctex-forward" "%l:1:%f" "%p" "-x" "${./kaktex} jump %%{input} %%{line} %%{column}" ];
}); });
}; };
}; };

View file

@ -3,11 +3,11 @@
function usage function usage
echo "Usage: " echo "Usage: "
echo " kaktex set [client] [session]" echo " kaktex set [client] [session]"
echo " kaktex jump [file] [line]" echo " kaktex jump [file] [line] [column]"
exit 1 exit 1
end end
if test (count $argv) -ne 3 if test (count $argv) -lt 3
usage usage
end end
@ -19,7 +19,7 @@ switch $argv[1]
echo " echo "
evaluate-commands -client $_kaktex_client %{ evaluate-commands -client $_kaktex_client %{
evaluate-commands -try-client $_kaktex_client %{ evaluate-commands -try-client $_kaktex_client %{
edit -- $argv[2] $argv[3] edit -existing -- $argv[2] $(math $argv[3] + 1) $(math $argv[4] + 1)
} }
} }
" | kak -p $_kaktex_session " | kak -p $_kaktex_session

View file

@ -1,22 +1,12 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let
kaktexScript = ./kaktex;
in
{ {
# Create kak-tex executable
home.file.kaktex = {
source = kaktexScript;
executable = true;
target = ".bin/kaktex";
};
# Source kaktex whenever we have a tex file # Source kaktex whenever we have a tex file
programs.my-kakoune.rc = '' programs.my-kakoune.rc = ''
hook global WinSetOption filetype=(tex|latex) %{ hook global WinSetOption filetype=(tex|latex) %{
hook window WinDisplay '.*' %{ hook window WinDisplay '.*' %{
eval %sh{ eval %sh{
${kaktexScript} set $kak_client $kak_session ${./kaktex} set $kak_client $kak_session
} }
} }
} }