From 69659cfc9d081caf31c8d548dd4c19593839317b Mon Sep 17 00:00:00 2001 From: zharmany Date: Tue, 15 Mar 2022 05:06:21 -0700 Subject: [PATCH] Don't show errors when opening preview window (#810) * Don't show errors when opening preview window (occurs when buffer has unsaved changes). * Update autoload/tagbar.vim Co-authored-by: David Hegland Co-authored-by: David Hegland --- autoload/tagbar.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 4318122..70f6891 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -2500,9 +2500,12 @@ function! s:ShowInPreviewWin() abort " Open the preview window if it is not already open. This has to be done " explicitly before the :psearch below to better control its positioning. if !pwin_open - silent execute + let l:confirm = &confirm + let &confirm = 0 + silent! execute \ g:tagbar_previewwin_pos . ' pedit ' . \ fnameescape(taginfo.fileinfo.fpath) + let &confirm = l:confirm if g:tagbar_position !~# 'vertical' silent execute 'vertical resize ' . g:tagbar_width endif