File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ function! suda#read(expr, ...) abort range
8080 \ ' %sread %s %s' ,
8181 \ options .range ,
8282 \ options .cmdarg,
83- \ path ,
83+ \ fnameescape ( path ) ,
8484 \) ), ' ^\r\?\n' , ' ' , ' ' )
8585 endif
8686
@@ -99,7 +99,7 @@ function! suda#read(expr, ...) abort range
9999 \ ' %sread %s %s' ,
100100 \ options .range ,
101101 \ options .cmdarg,
102- \ tempfile,
102+ \ fnameescape ( tempfile) ,
103103 \) )
104104 " Rewrite message with a correct file name
105105 let echo_message = substitute (
@@ -133,7 +133,7 @@ function! suda#write(expr, ...) abort range
133133 \ options .range ,
134134 \ options .cmdbang ? ' !' : ' ' ,
135135 \ options .cmdarg,
136- \ tempfile,
136+ \ fnameescape ( tempfile) ,
137137 \) )
138138 if has (' win32' )
139139 " In MS Windows, tee.exe has been placed at $VIMRUNTIME and $VIMRUNTIME
@@ -274,7 +274,7 @@ function! suda#BufEnter() abort
274274 let bufnr = str2nr (expand (' <abuf>' ))
275275 execute printf (
276276 \ ' keepalt keepjumps edit suda://%s' ,
277- \ fnamemodify (bufname , ' :p' ),
277+ \ fnameescape ( fnamemodify (bufname , ' :p' ) ),
278278 \)
279279 execute printf (' silent! %dbwipeout' , bufnr )
280280endfunction
Original file line number Diff line number Diff line change @@ -20,12 +20,12 @@ augroup END
2020
2121function ! s: read (args ) abort
2222 let args = empty (a: args ) ? expand (' %:p' ) : a: args
23- execute printf (' edit suda://%s' , args )
23+ execute printf (' edit suda://%s' , fnameescape ( args ) )
2424endfunction
2525command ! -nargs =? -complete =file SudaRead call s: read (<q-args> )
2626
2727function ! s: write (args ) abort
2828 let args = empty (a: args ) ? expand (' %:p' ) : a: args
29- execute printf (' write suda://%s' , args )
29+ execute printf (' write suda://%s' , fnameescape ( args ) )
3030endfunction
3131command ! -nargs =? -complete =file SudaWrite call s: write (<q-args> )
You can’t perform that action at this time.
0 commit comments