From 9adda7d195222d4e2854efb2a88005a120296c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=9Blisue?= Date: Sun, 8 Dec 2024 12:53:37 +0900 Subject: [PATCH] Prevent using 'swapfile' on 'suda#BufReadCmd' (#88) Close #87 --- autoload/suda.vim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/autoload/suda.vim b/autoload/suda.vim index 8cf6409..f6069dd 100644 --- a/autoload/suda.vim +++ b/autoload/suda.vim @@ -99,7 +99,6 @@ function! suda#read(expr, ...) abort range else " write with 'b' to ensure contents are the same call writefile(resultlist, tempfile, 'b') - " TODO: (aarondill) can we use readfile() here? let echo_message = execute(printf( \ '%sread %s %s', \ options.range, @@ -181,12 +180,12 @@ function! suda#BufReadCmd() abort let ul = &undolevels set undolevels=-1 try + setlocal noswapfile noundofile let echo_message = suda#read('', { \ 'range': '1', \}) silent 0delete _ setlocal buftype=acwrite - setlocal noswapfile noundofile setlocal nomodified filetype detect redraw | echo echo_message