Here is a piece of code that creates the popup:
:function! PopupDemo()
let message = 'Hello World'
for i in range(10)
let message = message . ' ' . message
endfor
let s:win_buf = bufadd('popup-demo')
call bufload(s:win_buf)
call setbufline(s:win_buf, 1, message)
echo 'buf id: ' . s:win_buf
let width = 40
let height = 10
" Set the new window as the current window.
let enter = v:false
" Calculate the centering coordinates.
let win_x = &columns / 2 - width / 2
let win_y = &lines / 2 - height / 2
let s:win_id = nvim_open_win(s:win_buf, enter, {
\'relative': 'editor',
\'row': win_y,
\'col': win_x,
\'width': width,
\'height': height,
\'focusable': v:false,
\'style': 'minimal',
\'border': ['╔', '═','╗', '║', '╝', '═', '╚', '║'],
\'noautocmd': v:false,
\'bufpos': [0, 0]
\})
call nvim_win_set_option(s:win_id, 'wrap', v:true)
:endfunction
:function! PopupClose(timer)
if s:win_id != 0
call nvim_win_close(s:win_id, v:false)
endif
if s:win_buf != 0
call nvim_buf_delete(s:win_buf, {'force': v:true})
endif
:endfunction
After I create a buffer and a pop-up window through the PopupDemo() function, I do not call the PopupClose() function to close the window, but directly use the :wq command to save the file and exit neovim, the following error message will appear:
E37: No write since last change
E162: No write since last change for buffer "popup-demo"
I want file save instructions like ":w", ":wq" and ".wqall" to ignore the popup's buffer, how can I do this?
neovim version: v0.7.2