[vim/vim] bufload() occurs E325 error when swap file exists (#8333)

52 views
Skip to first unread message

thinca

unread,
Jun 6, 2021, 7:32:13 AM6/6/21
to vim/vim, Subscribed

Describe the bug

bufload() occurs E325 error when swap file exists.

:help bufload() says:

		If there is an existing swap file for the file of the buffer,
		there will be no dialog, the buffer will be loaded anyway.

E325 is not a dialog, but it stops the running of the script.
I guess there will be no dialog means scripts keep running without any user interaction.
So I thinks this behavior is not expected.

To Reproduce

Detailed steps to reproduce the behavior:

  1. Run vim --clean test.txt
  2. Open other terminal
  3. Run vim --clean
  4. Execute :call bufload(bufnr('test.txt', 1)) in second Vim

Expected behavior

E325 does not occurred.

Screenshots

image

Environment (please complete the following information):

  • Vim version 8.2.2948
  • OS: Arch Linux
  • Terminal: Windows Terminal and tmux 3.2

Additional context
Nothing


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Bram Moolenaar

unread,
Jun 6, 2021, 8:57:36 AM6/6/21
to vim/vim, Subscribed

I'm not sure we want to change this. You can use ":silent!" to not get the error.
You can also use try/catch, but the "Found a swap file" message will still show.

thinca

unread,
Jun 6, 2021, 8:59:12 AM6/6/21
to vim/vim, Subscribed

OK. Thank you.

thinca

unread,
Jun 6, 2021, 8:59:14 AM6/6/21
to vim/vim, Subscribed

Closed #8333.

Reply all
Reply to author
Forward
0 new messages