Skip to content

Commit cc254b5

Browse files
author
skywind3000
committed
Refactor buffer handling functions to use silent call before deletebufline to prevent error messages from showing up.
1 parent 60ee57e commit cc254b5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

autoload/quickui/core.vim

+3-3
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ function! quickui#core#buffer_alloc()
412412
endif
413413
endif
414414
call setbufvar(bid, '&modifiable', 1)
415-
call deletebufline(bid, 1, '$')
415+
silent call deletebufline(bid, 1, '$')
416416
call setbufvar(bid, '&modified', 0)
417417
call setbufvar(bid, '&filetype', '')
418418
return bid
@@ -429,7 +429,7 @@ function! quickui#core#buffer_free(bid)
429429
let index = len(s:buffer_array)
430430
let s:buffer_array[index] = a:bid
431431
call setbufvar(a:bid, '&modifiable', 1)
432-
call deletebufline(a:bid, 1, '$')
432+
silent call deletebufline(a:bid, 1, '$')
433433
call setbufvar(a:bid, '&modified', 0)
434434
endfunc
435435

@@ -444,7 +444,7 @@ function! quickui#core#buffer_update(bid, textlist)
444444
let textlist = split('' . a:textlist, '\n', 1)
445445
endif
446446
call setbufvar(a:bid, '&modifiable', 1)
447-
call deletebufline(a:bid, 1, '$')
447+
silent call deletebufline(a:bid, 1, '$')
448448
call setbufline(a:bid, 1, textlist)
449449
call setbufvar(a:bid, '&modified', 0)
450450
endfunc

0 commit comments

Comments
 (0)