Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
576e0992
Commit
576e0992
authored
Sep 13, 2019
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
z: update to latest version (e77e938)
Closes #8145 Co-authored-by:
GHPS
<
GHPS@users.noreply.github.com
>
parent
093b56a7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
z.sh
plugins/z/z.sh
+13
-12
No files found.
plugins/z/z.sh
View file @
576e0992
...
@@ -89,7 +89,7 @@ _z() {
...
@@ -89,7 +89,7 @@ _z() {
if
[
$?
-ne
0
-a
-f
"
$datafile
"
]
;
then
if
[
$?
-ne
0
-a
-f
"
$datafile
"
]
;
then
env rm
-f
"
$tempfile
"
env rm
-f
"
$tempfile
"
else
else
[
"
$_Z_OWNER
"
]
&&
chown
$_Z_OWNER
:
$(
id
-ng
$_Z_OWNER
)
"
$tempfile
"
[
"
$_Z_OWNER
"
]
&&
chown
$_Z_OWNER
:
"
$(
id
-ng
$_Z_OWNER
)
"
"
$tempfile
"
env mv
-f
"
$tempfile
"
"
$datafile
"
||
env rm
-f
"
$tempfile
"
env mv
-f
"
$tempfile
"
"
$datafile
"
||
env rm
-f
"
$tempfile
"
fi
fi
...
@@ -110,20 +110,21 @@ _z() {
...
@@ -110,20 +110,21 @@ _z() {
else
else
# list/go
# list/go
local echo
fnd last list opt typ
while
[
"
$1
"
]
;
do case
"
$1
"
in
while
[
"
$1
"
]
;
do case
"
$1
"
in
--
)
while
[
"
$1
"
]
;
do
shift
;
local
fnd
=
"
$fnd
${
fnd
:+
}
$1
"
;
done
;;
--
)
while
[
"
$1
"
]
;
do
shift
;
fnd
=
"
$fnd
${
fnd
:+
}
$1
"
;
done
;;
-
*
)
local
opt
=
${
1
:1
}
;
while
[
"
$opt
"
]
;
do case
${
opt
:0:1
}
in
-
*
)
opt
=
${
1
:1
}
;
while
[
"
$opt
"
]
;
do case
${
opt
:0:1
}
in
c
)
local
fnd
=
"^
$PWD
$fnd
"
;;
c
)
fnd
=
"^
$PWD
$fnd
"
;;
e
)
local
echo
=
1
;;
e
)
echo
=
1
;;
h
)
echo
"
${
_Z_CMD
:-
z
}
[-cehlrtx] args"
>
&2
;
return
;;
h
)
echo
"
${
_Z_CMD
:-
z
}
[-cehlrtx] args"
>
&2
;
return
;;
l
)
l
ocal
l
ist
=
1
;;
l
)
list
=
1
;;
r
)
local
typ
=
"rank"
;;
r
)
typ
=
"rank"
;;
t
)
local
typ
=
"recent"
;;
t
)
typ
=
"recent"
;;
x
)
sed
-i
-e
"
\:
^
${
PWD
}
|.*:d"
"
$datafile
"
;;
x
)
sed
-i
-e
"
\:
^
${
PWD
}
|.*:d"
"
$datafile
"
;;
esac
;
opt
=
${
opt
:1
}
;
done
;;
esac
;
opt
=
${
opt
:1
}
;
done
;;
*
)
local
fnd
=
"
$fnd
${
fnd
:+
}
$1
"
;;
*
)
fnd
=
"
$fnd
${
fnd
:+
}
$1
"
;;
esac
;
l
ocal
l
ast
=
$1
;
[
"$#"
-gt
0
]
&&
shift
;
done
esac
;
last
=
$1
;
[
"$#"
-gt
0
]
&&
shift
;
done
[
"
$fnd
"
-a
"
$fnd
"
!=
"^
$PWD
"
]
||
l
ocal
l
ist
=
1
[
"
$fnd
"
-a
"
$fnd
"
!=
"^
$PWD
"
]
||
list
=
1
# if we hit enter on a completion just go there
# if we hit enter on a completion just go there
case
"
$last
"
in
case
"
$last
"
in
...
@@ -147,7 +148,7 @@ _z() {
...
@@ -147,7 +148,7 @@ _z() {
function output(matches, best_match, common) {
function output(matches, best_match, common) {
# list or return the desired directory
# list or return the desired directory
if( list ) {
if( list ) {
cmd = "
sort
-
n
>
&2
"
cmd = "
sort
-
g
>
&2
"
for( x in matches ) {
for( x in matches ) {
if( matches[x] ) {
if( matches[x] ) {
printf "
%-10s %s
\n
", matches[x], x | cmd
printf "
%-10s %s
\n
", matches[x], x | cmd
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment