mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-22 13:50:09 +00:00
Fix builtin `ecd' when file path contains space characters.
This commit is contained in:
parent
574de93efb
commit
7066bf7c6b
1 changed files with 2 additions and 2 deletions
|
@ -31,13 +31,13 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then
|
|||
$EDITOR --eval "$cmd" | tr -d \"
|
||||
}
|
||||
|
||||
# display the directory of the file
|
||||
# Write to standard output the directory of the file
|
||||
# opened in the the current buffer
|
||||
function ecd {
|
||||
local cmd="(let ((buf-name (buffer-file-name (window-buffer))))
|
||||
(if buf-name (file-name-directory buf-name)))"
|
||||
|
||||
local dir=`$EDITOR --eval "$cmd" | tr -d \"`
|
||||
local dir="$($EDITOR --eval $cmd | tr -d \")"
|
||||
if [ -n "$dir" ] ;then
|
||||
echo "$dir"
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue