'viewdir' doesn't work by default after migration to XDG_BASE_DIR
returnDanilo opened this issue · comments
Steps to reproduce
First, verify normal behavior(that is, without patch 9.1.0327):
- Put
viewoptions=cursors
in your vimrc. - Open a file.
- Scroll down a bit to change cursor position.
- Close the file.
- Open the same file.
- Notice how the cursor position was remembered as intended.
Now, using a build which includes patch 9.1.0327:
- Move your
~/.vim
directory under~/.config
. - Put
viewoptions=cursors
in~/.config/vim/vimrc
. - Open a file
- Scroll down a bit to change cursor position.
- Close the file.
- Open the same file.
- Notice how the cursors position is not remembered: It always starts at line 1.
To get the old behavior, one has to change the viewdir
value to, for example, ~/.config/vim/view
.
Note: If a ~/.vim
directory exists, even if empty, the cursor position will be correctly remembered, but the view file will be created under this directory instead; thus not respecting the xdg base dir set.
Related to: #14182
Expected behaviour
Expected for vim to continue working normally, without further tweaks, after moving .vim
to .config
.
Alternatively, expected viewdir
option to default to using an XDG_BASE_DIR-friendly value if other options(such as rtp
) are set to follow the XDG_BASE_DIR.
Version of Vim
9.1 Included patches: 1-384
Environment
OS: Linux
Logs and stack traces
No response