33" Last Change: May 2, 2013
44" URL: http://peterodding.com/code/vim/session/
55
6- let g: xolox #session#version = ' 1.6.2 '
6+ let g: xolox #session#version = ' 1.6.3 '
77
88call xolox#misc#compat#check (' session' , 2 )
99
@@ -452,8 +452,8 @@ function! xolox#session#restart_cmd(bang, args) abort " {{{2
452452 if name == ' ' | let name = ' restart' | endif
453453 call xolox#session#save_cmd (name, a: bang )
454454 " 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))
457457 let args = matchstr (a: args , ' ^\s*|\s*\zs.\+$' )
458458 if ! empty (args )
459459 let command .= ' -c ' . xolox#misc#escape#shell (args )
@@ -479,6 +479,18 @@ function! xolox#session#restart_cmd(bang, args) abort " {{{2
479479 endif
480480endfunction
481481
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+
482494" Miscellaneous functions. {{{1
483495
484496function ! s: unescape (s ) " {{{2
0 commit comments