summaryrefslogtreecommitdiffstats
path: root/src/ui.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui.sh')
-rw-r--r--src/ui.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ui.sh b/src/ui.sh
index a41cb85..c8ab0a0 100644
--- a/src/ui.sh
+++ b/src/ui.sh
@@ -7,7 +7,7 @@ ui::pick() {
ui::select() {
local readonly cheats="$1"
local readonly script_path="$(which navi | head -n1 || echo "${SCRIPT_DIR}/navi")"
- local readonly preview_cmd="echo {} | tr ' ' '^' | xargs -I% \"${script_path}\" --command-for %"
+ local readonly preview_cmd="echo \"{}\" | tr ' ' '^' | xargs -I% \"${script_path}\" preview %"
local args=()
args+=("-i")
@@ -16,6 +16,13 @@ ui::select() {
args+=("--preview"); args+=("$preview_cmd")
args+=("--preview-window"); args+=("up:1")
fi
+ if [ -n "${query:-}" ]; then
+ args+=("--query=${query} ")
+ fi
+ if [ "${entry_point:-}" = "search" ]; then
+ args+=("--header")
+ args+=("Displaying online results. Please refer to 'navi --help' for details")
+ fi
echo "$cheats" \
| cheat::read_many \