aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_session.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-03-15 08:03:18 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-03-15 08:25:39 +0800
commit2ea16f73547391d014078b446d032a37c3585efa (patch)
tree18686d9347aabfe43937c39c7cb4dc5864c39d1f /src/nvim/ex_session.c
parent61126fcc693c1f5aca882cfc83794f8c344df8cd (diff)
downloadrneovim-2ea16f73547391d014078b446d032a37c3585efa.tar.gz
rneovim-2ea16f73547391d014078b446d032a37c3585efa.tar.bz2
rneovim-2ea16f73547391d014078b446d032a37c3585efa.zip
vim-patch:8.2.4566: check for existing buffer in session file may not work
Problem: Check for existing buffer in session file does not work for files in the home directory. Solution: Use fnamemodify(). (James Cherti, closes vim/vim#9945) Add a test. https://github.com/vim/vim/commit/7d42840033aedf36389208b62e28b4e0b251c199
Diffstat (limited to 'src/nvim/ex_session.c')
-rw-r--r--src/nvim/ex_session.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/ex_session.c b/src/nvim/ex_session.c
index ca07174543..e398c1ee64 100644
--- a/src/nvim/ex_session.c
+++ b/src/nvim/ex_session.c
@@ -365,7 +365,7 @@ static int put_view(FILE *fd, win_T *wp, int add_edit, unsigned *flagp, int curr
// edit that buffer, to not lose folding information (:edit resets
// folds in other buffers)
if (fprintf(fd,
- "if bufexists(\"%s\") | buffer %s | else | edit %s | endif\n"
+ "if bufexists(fnamemodify(\"%s\", \":p\")) | buffer %s | else | edit %s | endif\n"
// Fixup :terminal buffer name. #7836
"if &buftype ==# 'terminal'\n"
" silent file %s\n"