Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions plugin/sync.vim
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ endfunction
function! SyncUploadFile()
let exe = SyncGetExe()
if !empty(exe)
let fold = substitute(expand('%:p:h'), exe[0:strridx(exe, '/')], "", "")
let l:fdir = expand('%:p:h')
let l:pdir = exe[0:strridx(exe, '/')]
if l:fdir . '/' == l:pdir
let fold = './'
else
let fold = substitute(l:fdir, l:pdir, '', '')
endif
"let fold = substitute(expand('%:p:h'), exe[0:strridx(exe, '/')], "", "")
let filelist = split(expand('%:p'), '/')
let file = filelist[-1]
let cmd = printf("%s %s %s %s", exe, 'upload', fold, shellescape(file))
Expand All @@ -43,7 +50,14 @@ endfunction
function! SyncDownloadFile()
let exe = SyncGetExe()
if !empty(exe)
let fold = substitute(expand('%:p:h'), exe[0:strridx(exe, '/')], "", "")
"let fold = substitute(expand('%:p:h'), exe[0:strridx(exe, '/')], "", "")
let l:fdir = expand('%:p:h')
let l:pdir = exe[0:strridx(exe, '/')]
if l:fdir . '/' == l:pdir
let fold = './'
else
let fold = substitute(l:fdir, l:pdir, '', '')
endif
let filelist = split(expand('%:p'), '/')
let file = filelist[-1]
let cmd = printf("%s %s %s %s", exe, 'download', fold, shellescape(file))
Expand Down