3
3
" Last Change: May 2, 2013
4
4
" URL: http://peterodding.com/code/vim/session/
5
5
6
- let g: xolox #session#version = ' 1.6.2 '
6
+ let g: xolox #session#version = ' 1.6.3 '
7
7
8
8
call xolox#misc#compat#check (' session' , 2 )
9
9
@@ -452,8 +452,8 @@ function! xolox#session#restart_cmd(bang, args) abort " {{{2
452
452
if name == ' ' | let name = ' restart' | endif
453
453
call xolox#session#save_cmd (name, a: bang )
454
454
" Generate the Vim command line.
455
- let progname = xolox#misc#escape#shell (fnameescape (v: progname ))
456
- let command = progname . ' -c ' . xolox#misc#escape#shell (' OpenSession\! ' . fnameescape (name))
455
+ let progname = xolox#misc#escape#shell (fnameescape (s: find_executable () ))
456
+ let command = progname . ' -g - c ' . xolox#misc#escape#shell (' OpenSession\! ' . fnameescape (name))
457
457
let args = matchstr (a: args , ' ^\s*|\s*\zs.\+$' )
458
458
if ! empty (args )
459
459
let command .= ' -c ' . xolox#misc#escape#shell (args )
@@ -479,6 +479,18 @@ function! xolox#session#restart_cmd(bang, args) abort " {{{2
479
479
endif
480
480
endfunction
481
481
482
+ function ! s: find_executable ()
483
+ let progname = v: progname
484
+ if has (' macunix' )
485
+ " Special handling for Mac OS X where MacVim is usually not on the $PATH.
486
+ let segments = xolox#misc#path#split ($VIMRUNTIME )
487
+ if segments[-3 :] == [' Resources' , ' vim' , ' runtime' ]
488
+ let progname = xolox#misc#path#join (segments[0 :-4 ] + [' MacOS' , ' Vim' ])
489
+ endif
490
+ endif
491
+ return progname
492
+ endfunction
493
+
482
494
" Miscellaneous functions. {{{1
483
495
484
496
function ! s: unescape (s ) " {{{2
0 commit comments