-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add MSYS2 support as a vim plugin #1677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
43213de
c95d52f
502432f
ca770ec
abde451
637d59f
a1bbd6b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,7 +50,7 @@ if s:is_win | |
| " Use utf-8 for fzf.vim commands | ||
| " Return array of shell commands for cmd.exe | ||
| function! s:wrap_cmds(cmds) | ||
| return map(['@echo off', 'for /f "tokens=4" %%a in (''chcp'') do set origchcp=%%a', 'chcp 65001 > nul'] + | ||
| return map(['@echo off', 'set TERM= > nul', 'for /f "tokens=4" %%a in (''chcp'') do set origchcp=%%a', 'chcp 65001 > nul'] + | ||
| \ (type(a:cmds) == type([]) ? a:cmds : [a:cmds]) + | ||
| \ ['chcp %origchcp% > nul'], 'v:val."\r"') | ||
| endfunction | ||
|
|
@@ -75,7 +75,7 @@ function! s:shellesc_cmd(arg) | |
| endfunction | ||
|
|
||
| function! fzf#shellescape(arg, ...) | ||
| let shell = get(a:000, 0, &shell) | ||
| let shell = get(a:000, 0, s:is_win ? 'cmd.exe' : &shell) | ||
|
||
| if shell =~# 'cmd.exe$' | ||
| return s:shellesc_cmd(a:arg) | ||
| endif | ||
|
|
@@ -334,19 +334,20 @@ function! fzf#wrap(...) | |
| endfunction | ||
|
|
||
| function! s:use_sh() | ||
| let [shell, shellslash] = [&shell, &shellslash] | ||
| let [shell, shellslash, shellcmdflag] = [&shell, &shellslash, &shellcmdflag] | ||
| if s:is_win | ||
| set shell=cmd.exe | ||
| set shellcmdflag=/c | ||
|
||
| set noshellslash | ||
| else | ||
| set shell=sh | ||
| endif | ||
| return [shell, shellslash] | ||
| return [shell, shellslash, shellcmdflag] | ||
| endfunction | ||
|
|
||
| function! fzf#run(...) abort | ||
| try | ||
| let [shell, shellslash] = s:use_sh() | ||
| let [shell, shellslash, shellcmdflag] = s:use_sh() | ||
|
|
||
| let dict = exists('a:1') ? s:upgrade(a:1) : {} | ||
| let temps = { 'result': s:fzf_tempname() } | ||
|
|
@@ -416,7 +417,7 @@ try | |
| call s:callback(dict, lines) | ||
| return lines | ||
| finally | ||
| let [&shell, &shellslash] = [shell, shellslash] | ||
| let [&shell, &shellslash, &shellcmdflag] = [shell, shellslash, shellcmdflag] | ||
| endtry | ||
| endfunction | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.