[vim/vim] Patchmode does not use backupdir (#8085)

34 views
Skip to first unread message

Chuan Wei Foo

unread,
Apr 7, 2021, 5:38:18 PM4/7/21
to vim/vim, Subscribed

Describe the bug
When the patchmode option is non-empty, patchmode files are not placed into the directory specified by the backupdir option.

With set backup, set backupdir=~/.vim/backups, and set patchmode=.orig, patchmode files are not created in the backupdir, but in the directory of the files edited.

To Reproduce

  1. mkdir -p ~/.vim/backups
  2. cd ~ && echo 'Hello' > hello.txt
  3. vim --clean hello.txt
  4. :set backup backupdir=~/.vim/backups patchmode=.orig
  5. Insert some text.
  6. Save and exit (:wq)
  7. Observation: the patchmode file gets created in the directory of the edited file: ~ (~/hello.txt.orig).

Expected behavior
The patchmode file should have been placed in the backupdir instead (~/.vim/backups/hello.txt.orig).

Environment

  • Vim version: 8.1.2269
  • OS: Ubuntu 20.04
  • Terminal: GNOME Terminal

Additional context

If this is not a bug, then this is a feature request: add a patchmodedir option.

Relevant mailing list threads from many years ago:


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

Christian Brabandt

unread,
Jun 1, 2021, 5:23:43 AM6/1/21
to vim/vim, Subscribed

I think this is a duplicate of #5791 (more or less). Note this part in the documentation (:h 'patchmode'):

(Detail: The backup file is renamed to the patchmode file after the new file has been successfully written, that's why it must be possible to write a backup file)

Christian Brabandt

unread,
Jun 22, 2021, 1:44:02 PM6/22/21
to vim/vim, Subscribed

closing as being a duplicate.

Christian Brabandt

unread,
Jun 24, 2021, 10:29:09 AM6/24/21
to vim/vim, Subscribed

Closed #8085.

Reply all
Reply to author
Forward
0 new messages