From 6e42b764b906b5090630da2a75f76d1b41746c0f Mon Sep 17 00:00:00 2001 From: Vivian De Smedt Date: Mon, 14 Apr 2025 15:01:49 +0200 Subject: [PATCH] check the correct buffer to detect change in the CtrlSFClose command --- autoload/ctrlsf/buf.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/ctrlsf/buf.vim b/autoload/ctrlsf/buf.vim index 3c23240..3f9e560 100644 --- a/autoload/ctrlsf/buf.vim +++ b/autoload/ctrlsf/buf.vim @@ -87,7 +87,8 @@ endf " WarnIfChanged() " func! ctrlsf#buf#WarnIfChanged() abort - if getbufvar('%', '&modified') + let bufnr = bufnr('__CtrlSF__') + if getbufvar(bufnr, '&modified') call ctrlsf#log#Warn("Will discard ALL unsaved changes, continue? (y/N)") let confirm = nr2char(getchar()) | redraw! if !(confirm ==? "y")