From db0cb5a5558a11d4d691422bc88a34a25a2f5daa Mon Sep 17 00:00:00 2001 From: Johannes Wienke Date: Sun, 17 May 2015 00:21:06 +0200 Subject: [PATCH] fish completion: use literal tabs in sed calls sed on OS X does not understand \t. Therefore, replace all \t's with literal tabs. --- AUTHORS | 1 + ChangeLog | 2 ++ scripts/fish/task.fish | 10 ++++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/AUTHORS b/AUTHORS index 4a1359a77..b7597ff6b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -119,6 +119,7 @@ The following submitted code, packages or analysis, and deserve special thanks: Oota Toshiya ribbon Daniel Shahaf + Johannes Wienke Thanks to the following, who submitted detailed bug reports and excellent suggestions: diff --git a/ChangeLog b/ChangeLog index 0ba5438eb..930662cfe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -47,6 +47,8 @@ (thanks to Denis Kasak). - TW-1615 Japanese translation for Taskwarrior(150513) (thanks to ribbon). - TW-1617 Can't search for multi-word project (thanks to Audrey Easterday). +- TW-1619 fish completion contain backspaces in fish master version (thanks to + Johannes Wienke₎. - TW-1622 Duration UDA can't take an algebraic expression (thanks to Jeremy John Reeder). - TW-1626 Wrong wait date (thanks to Andrea Rizzi). diff --git a/scripts/fish/task.fish b/scripts/fish/task.fish index 21d795c4a..989563e82 100644 --- a/scripts/fish/task.fish +++ b/scripts/fish/task.fish @@ -55,6 +55,8 @@ # # http://www.opensource.org/licenses/mit-license.php +# NOTE: remember that sed on OS X is different in some aspects. E.g. it does +# not understand \t for tabs. # convinience functions @@ -74,7 +76,7 @@ end function __fish.task.zsh set -q argv[2]; and set task_argv $argv[2..-1] - task _zsh$argv[1] $task_argv | sed 's/:/\t/' + task _zsh$argv[1] $task_argv | sed 's/:/ /' end @@ -141,7 +143,7 @@ function __fish.task.token_clean end function __fish.task.list.attr_name - task _columns | sed 's/$/:\tattribute/g' + task _columns | sed 's/$/: attribute/g' # BUG: doesn't support file completion echo rc end @@ -149,7 +151,7 @@ end function __fish.task.list.attr_value set token (commandline -ct | cut -d ':' -f 1 | cut -d '.' -f 1 | __fish.task.token_clean) if test -n $token - set attr_names (__fish.task.list.attr_name | sed 's/:\t/\t/g' | grep '^'$token | cut -d ' ' -f 1) + set attr_names (__fish.task.list.attr_name | sed 's/: / /g' | grep '^'$token | cut -d ' ' -f 1) for attr_name in $attr_names if test -n $attr_name __fish.task.list.attr_value_by_name $attr_name @@ -250,7 +252,7 @@ function __fish.task.list.tag end function __fish.task.list.task - __fish.task.zsh ids | sed -E 's/^(.*)\t(.*)$/\2\ttask [id = \1]/g' + __fish.task.zsh ids | sed -E 's/^(.*) (.*)$/\2 task [id = \1]/g' end function __fish.task.list