diff options
Diffstat (limited to 'src/ui.sh')
-rw-r--r-- | src/ui.sh | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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 \ |