From: Michael D. Lowis Date: Wed, 9 Jan 2019 14:32:11 +0000 (-0500) Subject: fixed a minor bug in picktag and added a new shortcut for filename/filepath completio... X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=d09942d575d1a1a1452af447766f0d6d5cb578e7;p=projs%2Ftide.git fixed a minor bug in picktag and added a new shortcut for filename/filepath completion using the picker --- diff --git a/TODO.md b/TODO.md index 210eed7..86a7808 100644 --- a/TODO.md +++ b/TODO.md @@ -9,7 +9,6 @@ * registrar: should remove invalid windows from registry when detected * tide: Ctrl+D should not pass tag name as arg when executing tag commands * tide: gap buffer does not handle UTF-8 currently -* filename/path completion shortcut * pick can return null if mouse clicked on empty row ## BACKLOG diff --git a/bin/fcomplete b/bin/fcomplete new file mode 100755 index 0000000..2575387 --- /dev/null +++ b/bin/fcomplete @@ -0,0 +1,6 @@ +#!/bin/sh +orig="$1" +path="${orig%/*}" +file="${orig##*/}" +[ "$path" == "$file" ] && path="." +printf "%s" "$(find "$path" -path "$path/$file*" | pick "$path/$file")" diff --git a/bin/picktag b/bin/picktag index 1508e9e..73d41c2 100755 --- a/bin/picktag +++ b/bin/picktag @@ -21,7 +21,9 @@ printtags(){ } print(){ - printf "%s" "$(printtags | pick "$TAG")" + tag="$(printtags | pick "$TAG")" + [ "" == "$tag" ] && tag="$TAG" + printf "%s" "$tag" } fetch(){ diff --git a/config.h b/config.h index 9dfd6a5..08ed519 100644 --- a/config.h +++ b/config.h @@ -15,6 +15,7 @@ enum { /* Color Names */ #define CMD_TIDE "!tide" #define CMD_PICKFILE "!pickfile ." #define CMD_COMPLETE "