Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fzf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
fzf
Commits
207aa078
Commit
207aa078
authored
9 years ago
by
Junegunn Choi
Browse files
Options
Downloads
Patches
Plain Diff
[zsh-completion] Temporarily set nonomatch (#230)
No error on ~INVALID_USERNAME**<TAB>
parent
26a141c6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
shell/completion.zsh
+7
-2
7 additions, 2 deletions
shell/completion.zsh
test/test_go.rb
+12
-2
12 additions, 2 deletions
test/test_go.rb
with
19 additions
and
4 deletions
shell/completion.zsh
+
7
−
2
View file @
207aa078
...
...
@@ -11,7 +11,7 @@
# - $FZF_COMPLETION_OPTS (default: empty)
_fzf_path_completion
()
{
local
base lbuf find_opts fzf_opts suffix
tail
fzf
dir
leftover matches
local
base lbuf find_opts fzf_opts suffix
tail
fzf
dir
leftover matches
nnm
base
=
$1
lbuf
=
$2
find_opts
=
$3
...
...
@@ -20,6 +20,10 @@ _fzf_path_completion() {
tail
=
$6
[
${
FZF_TMUX
:-
1
}
-eq
1
]
&&
fzf
=
"fzf-tmux -d
${
FZF_TMUX_HEIGHT
:-
40
%
}
"
||
fzf
=
"fzf"
if
!
setopt |
grep
nonomatch
>
/dev/null
;
then
nnm
=
1
setopt nonomatch
fi
dir
=
"
$base
"
while
[
1
]
;
do
if
[
-z
"
$dir
"
-o
-d
${
~dir
}
]
;
then
...
...
@@ -35,11 +39,12 @@ _fzf_path_completion() {
LBUFFER
=
"
$lbuf$matches$tail
"
zle redisplay
fi
re
turn
b
re
ak
fi
dir
=
$(
dirname
"
$dir
"
)
dir
=
${
dir
%/
}
/
done
[
-n
"
$nnm
"
]
&&
unsetopt nonomatch
}
_fzf_all_completion
()
{
...
...
This diff is collapsed.
Click to expand it.
test/test_go.rb
+
12
−
2
View file @
207aa078
...
...
@@ -574,7 +574,7 @@ end
module
CompletionTest
def
test_file_completion
tmux
.
send_keys
'mkdir -p /tmp/fzf-test; touch /tmp/fzf-test/{1..100}; touch ~/fzf-home'
,
:Enter
tmux
.
send_keys
'mkdir -p /tmp/fzf-test; touch /tmp/fzf-test/{1..100}; touch ~/fzf-home
no~such~user
'
,
:Enter
tmux
.
prepare
tmux
.
send_keys
'cat /tmp/fzf-test/10**'
,
:Tab
,
pane:
0
tmux
.
until
(
1
)
{
|
lines
|
lines
.
item_count
>
0
}
...
...
@@ -594,7 +594,17 @@ module CompletionTest
tmux
.
send_keys
:Enter
tmux
.
until
do
|
lines
|
tmux
.
send_keys
'C-L'
lines
[
-
1
].
include?
(
'fzf-home'
)
lines
[
-
1
].
end_with?
(
'fzf-home'
)
end
# ~INVALID_USERNAME**<TAB>
tmux
.
send_keys
'C-u'
tmux
.
send_keys
"cat ~such**"
,
:Tab
,
pane:
0
tmux
.
until
(
1
)
{
|
lines
|
lines
[
-
3
].
end_with?
'no~such~user'
}
tmux
.
send_keys
:Enter
tmux
.
until
do
|
lines
|
tmux
.
send_keys
'C-L'
lines
[
-
1
].
end_with?
(
'no~such~user'
)
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment