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
42a2371d
Commit
42a2371d
authored
8 years ago
by
Jan Edmund Lazo
Committed by
Junegunn Choi
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[vim] Use cmd.exe in Windows (#785)
parent
45faad7e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugin/fzf.vim
+30
-6
30 additions, 6 deletions
plugin/fzf.vim
with
30 additions
and
6 deletions
plugin/fzf.vim
+
30
−
6
View file @
42a2371d
...
...
@@ -80,7 +80,13 @@ function! s:shellesc(arg)
endfunction
function
!
s:escape
(
path
)
return
escape
(
a:path
,
' $%#''"\'
)
let
escaped_chars
=
'$%#''"'
if
has
(
'unix'
)
let
escaped_chars
.=
' \'
endif
return
escape
(
a:path
,
escaped_chars
)
endfunction
" Upgrade legacy options
...
...
@@ -234,7 +240,15 @@ endfunction
function
!
fzf#run
(...)
abort
try
let
oshell
=
&
shell
set
shell
=
sh
let
useshellslash
=
&
shellslash
if
has
(
'win32'
)
||
has
(
'win64'
)
set
shell
=
cmd
.
exe
set
shellslash
else
set
shell
=
sh
endif
if
has
(
'nvim'
)
&&
len
(
filter
(
range
(
1
,
bufnr
(
'$'
)),
'bufname(v:val) =~# ";#FZF"'
))
call
s:warn
(
'FZF is already running!'
)
return
[]
...
...
@@ -251,7 +265,7 @@ try
if
!
has_key
(
dict
,
'source'
)
&&
!
empty
(
$FZF_DEFAULT_COMMAND
)
let
temps
.
source
=
tempname
()
call
writefile
(
split
(
$FZF_DEFAULT_COMMAND
,
"\n"
),
temps
.
source
)
let
dict
.
source
=
(
empty
(
$SHELL
)
?
'
sh
'
:
$SHELL
)
.
' '
.
s:shellesc
(
temps
.
source
)
let
dict
.
source
=
(
empty
(
$SHELL
)
?
&
sh
ell
:
$SHELL
)
.
' '
.
s:shellesc
(
temps
.
source
)
endif
if
has_key
(
dict
,
'source'
)
...
...
@@ -281,6 +295,7 @@ try
return
lines
finally
let
&
shell
=
oshell
let
&
shellslash
=
useshellslash
endtry
endfunction
...
...
@@ -353,7 +368,11 @@ function! s:xterm_launcher()
\
&
columns
,
&
lines
/
2
,
getwinposx
(),
getwinposy
())
endfunction
unlet
!
s:launcher
let
s:launcher
=
function
(
's:xterm_launcher'
)
if
has
(
'win32'
)
||
has
(
'win64'
)
let
s:launcher
=
'cmd.exe /C %s'
else
let
s:launcher
=
function
(
's:xterm_launcher'
)
endif
function
!
s:exit_handler
(
code
,
command
,
...)
if
a:code
==
130
...
...
@@ -370,12 +389,17 @@ endfunction
function
!
s:execute
(
dict
,
command
,
temps
)
abort
call
s:pushd
(
a:dict
)
silent
!
!
clear
2
>
/dev/
null
if
has
(
'unix'
)
silent
!
!
clear
2
>
/dev/
null
endif
let
escaped
=
escape
(
substitute
(
a:command
,
'\n'
,
'\\n'
,
'g'
),
'%#'
)
if
has
(
'gui_running'
)
let
Launcher
=
get
(
a:dict
,
'launcher'
,
get
(
g
:,
'Fzf_launcher'
,
get
(
g
:,
'fzf_launcher'
,
s:launcher
)))
let
fmt
=
type
(
Launcher
)
==
2
?
call
(
Launcher
,
[])
:
Launcher
let
command
=
printf
(
fmt
,
"'"
.
substitute
(
escaped
,
"'"
,
"'\"'\"'"
,
'g'
).
"'"
)
if
has
(
'unix'
)
let
escaped
=
"'"
.
substitute
(
escaped
,
"'"
,
"'\"'\"'"
,
'g'
).
"'"
endif
let
command
=
printf
(
fmt
,
escaped
)
else
let
command
=
escaped
endif
...
...
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