diff --git a/scripts/tag b/scripts/tag index bb4d01e..1285df7 100755 --- a/scripts/tag +++ b/scripts/tag @@ -8,5 +8,5 @@ version="${1:-$(version_from_toml)}" echo "version: $version..." sleep 2 -git tag -a "v${version}" -m 'WIP version written in Rust. Use 1.0.0 instead' +git tag -a "v${version}" git push origin --tags diff --git a/shell/navi.plugin.bash b/shell/navi.plugin.bash index 8efc144..342d924 100644 --- a/shell/navi.plugin.bash +++ b/shell/navi.plugin.bash @@ -1,7 +1,26 @@ #!/usr/bin/env bash __call_navi() { - printf "$(navi --print)" + local -r result="$(navi --print)" + local -r linecount="$(echo "$result" | wc -l)" + + if [[ "$linecount" -lt 2 ]]; then + printf "$result" + return 0 + fi + + IFS=$'\n' + local i=1; + for line in $result; do + if echo "$line" | grep -q '\\$'; then + printf "${line::-1} " + elif [[ "$i" -eq "$linecount" ]]; then + printf "$line " + else + printf "${line}; " + fi + i=$((i+1)) + done } bind '"\C-g": " \C-b\C-k \C-u`__call_navi`\e\C-e\C-a\C-y\C-h\C-e\e \C-y\ey\C-x\C-x\C-f"' \ No newline at end of file diff --git a/tests/cheats/more_cases.cheat b/tests/cheats/more_cases.cheat index 651001a..044595a 100644 --- a/tests/cheats/more_cases.cheat +++ b/tests/cheats/more_cases.cheat @@ -35,6 +35,9 @@ echo " " # with preview cat "" +# fzf +ls / | fzf + $ x: echo '1 2 3' | tr ' ' '\n' $ y: echo 'a b c' | tr ' ' '\n' $ z: echo 'foo bar' | tr ' ' '\n'