From 1d3651904bd02cce987f25bd0bb8f5200a393177 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Mon, 15 Oct 2012 21:57:24 +1300 Subject: [PATCH] Only replace username when preceded by a space --- lib/git/shell_shortcuts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git/shell_shortcuts.sh b/lib/git/shell_shortcuts.sh index f227f77..3d560ef 100644 --- a/lib/git/shell_shortcuts.sh +++ b/lib/git/shell_shortcuts.sh @@ -96,7 +96,7 @@ if [ -e $HOME/.user_sym ]; then function rejustify_ls_columns(){ ruby -e "o=STDIN.read;re=/^(([^ ]* +){2})(([^ ]* +){3})/;u,g,s=o.lines.map{|l|l[re,3]}.compact.map(&:split).transpose.map{|a|a.map(&:size).max+1};puts o.lines.map{|l|l.sub(re){|m|\"%s%-#{u}s %-#{g}s%#{s}s \"%[\$1,*\$3.split]}}" } - _ls_processor="| sed \"s/$USER/\$(/bin/cat $HOME/.user_sym)/g\" | rejustify_ls_columns" + _ls_processor="| sed \"s/ $USER/ \$(/bin/cat $HOME/.user_sym)/g\" | rejustify_ls_columns" fi