From 0404c2daa20cd22c58059d0498f9565d61ef880a Mon Sep 17 00:00:00 2001 From: Giuliano Losa Date: Thu, 30 Sep 2021 15:09:13 -0700 Subject: [PATCH] minor improvement to vim-saw --- vim-saw/plugin/saw.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vim-saw/plugin/saw.vim b/vim-saw/plugin/saw.vim index 75b6225b63..30b08bc7fb 100644 --- a/vim-saw/plugin/saw.vim +++ b/vim-saw/plugin/saw.vim @@ -1,8 +1,9 @@ " a function that overrides vim-slime's default behavior: function SlimeOverride_EscapeText_saw(text) " create temp buffer - split __saw_slime_temp_buffer__ + keepalt split __saw_slime_temp_buffer__ setlocal buftype=nofile + setlocal bufhidden=delete " paste text in buffer set paste exe "normal! i" . a:text . "\" @@ -13,6 +14,6 @@ function SlimeOverride_EscapeText_saw(text) silent! keepp g/^\s*\/\/.*\n/d silent! keepp %s/\/\/.*$//eg " remove end-of-line comments let res = join(getline(1, '$'), "\\\n") " copy buffer contents into res, adding a backslash at the end of each line - bdelete __saw_slime_temp_buffer__ " delete temp buffer (the following didn't work reliably: setlocal bufhidden=delete) + bdelete __saw_slime_temp_buffer__ " delete temp buffer return res . "\n" endfunction