Open singlexyz opened 2 years ago
Sorry for my late response, and it seems a little difficult situation. Actually, the three commands would not succeed even if executed manually because each command changes the marks '[
, ']
.
A possible workaround is to make a function.
let g:sandwich#recipes += [
\ {
\ 'buns': ['[', ']'],
\ 'nesting': 1,
\ 'input': ['z'],
\ 'command': ['call SandwichQuoteInside()'],
\ },
\ ]
function! SandwichQuoteInside() abort
let l:start = line("'[") + 1
let l:end = line("']") - 1
execute printf('%d,%ds/\(.\+\)/"\1",/g', l:start, l:end)
execute printf('%d,%dnormal! ==', l:start, l:end)
execute printf('%d,%dg/^"\s*"$/d', l:start, l:end)
endfunction
I had this config:
It seems that the following replacement error is caused by the deletion of a line