dhruvasagar / vim-prosession

Handle vim sessions like a pro
254 stars 22 forks source link

Session files don't get generated with their paths when &shellslash is enabled in Windows #67

Closed nkmathew closed 4 years ago

nkmathew commented 4 years ago

Relevant: #37, #42


function! s:undofile(cwd) "{{{1
  if (exists('+shellslash') && &shellslash) || has('win16') || has('win32') || has('win64')
    return substitute(a:cwd, '\', '%', 'g')
  else
    return substitute(a:cwd, '/', '%', 'g')
  endif
endfunction

The check for shellslash on Windows on that line becomes useless because of the following statements. The only time getcwd() will return paths with backslashes is when &shellslash == 0 and given that Linux doesn't have it, the conditional should simply be:


  if exists('+shellslash') && !&shellslash
    return substitute(a:cwd, '\', '%', 'g')
  else
    return substitute(a:cwd, '/', '%', 'g')
  endif
dhruvasagar commented 4 years ago

@nkmathew Will you be able to test if I push this change on a separate branch ?

nkmathew commented 4 years ago

Yes I will

On Sun, Apr 19, 2020, 21:10 Dhruva Sagar notifications@github.com wrote:

@nkmathew https://github.com/nkmathew Will you be able to test if I push this change on a separate branch ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dhruvasagar/vim-prosession/issues/67#issuecomment-616198342, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKELBVPS3IQHE4M2SZ4TRLRNM5ALANCNFSM4ML2V2AQ .

dhruvasagar commented 4 years ago

@nkmathew I have pushed the changes you suggested in the branch fix-shellslash. Kindly test it on windows and let me know, unfortunately I do not have access to a windows box right now.

nkmathew commented 4 years ago

It works. The session files are created with percentages in place of the slashes both with shellslash enabled and disabled

dhruvasagar commented 4 years ago

@nkmathew Thanks, I will merge and push this.