# HG changeset patch # User Zeger Van de Vannet # Date 1714509249 -7200 # Node ID 979735a38885e02de7bdc51f46fdb35ebd0cd9ce # Parent ea090c39e4805dffb5919252944dad0c96343051 feat: add keybind with fzf selector for revisions from current stack diff -r ea090c39e480 -r 979735a38885 dot_config/private_fish/config.fish --- a/dot_config/private_fish/config.fish Mon Apr 29 18:33:04 2024 +0200 +++ b/dot_config/private_fish/config.fish Tue Apr 30 22:34:09 2024 +0200 @@ -21,6 +21,8 @@ bind \eg fzf_hg_status_files # Select output lines from last command bind \er fzf_last_command_output + # Select revisions from the stack + bind \ek fzf_hg_stack abbr hgst hg status end diff -r ea090c39e480 -r 979735a38885 dot_config/private_fish/functions/fzf_hg_stack.fish --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dot_config/private_fish/functions/fzf_hg_stack.fish Tue Apr 30 22:34:09 2024 +0200 @@ -0,0 +1,11 @@ +function fzf_hg_stack + set -l result (hg stack | fzf --ansi -m --header "Select the revsion(s)" --preview "echo {} | sed -rn 's/[[:space:]]*(s[[:digit:]]+).*/\1/p' | xargs hg diff --color=always -c" ) + if test -n "$result" + set -l revs + for rev in $result + set revs $revs (echo $rev | sed -rn 's/[[:space:]]*(s[[:digit:]]+).*/\1/p') + end + commandline -i (string join " " -- $revs "") + end + commandline -f repaint +end