diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-04-15 21:15:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-15 21:15:36 +0200 |
commit | aa82f8b88fe82077740894dd387801384e0558b6 (patch) | |
tree | b03732aa27ed20915b0bc6440b28f16098f14922 /src/nvim/shada.c | |
parent | 987619ddd73e792dc04b1a408b92cef2abb52bef (diff) | |
download | rneovim-aa82f8b88fe82077740894dd387801384e0558b6.tar.gz rneovim-aa82f8b88fe82077740894dd387801384e0558b6.tar.bz2 rneovim-aa82f8b88fe82077740894dd387801384e0558b6.zip |
vim-patch:8.0.0716: "--clean", 'shadafile' #9907
Nvim notes:
- Nvim does not support "-u DEFAULTS", that change is omitted.
- Also add 'shadafile' as an alias to 'viminfofile'.
- Deprecate 'viminfofile'.
Problem: Not easy to start Vim cleanly without changing the viminfo file.
Not possible to know whether the -i command line flag was used.
Solution: Add the --clean command line argument. Add the 'viminfofile'
option. Add "-u DEFAULTS".
https://github.com/vim/vim/commit/c4da113ef98dcfd6f2a088b1693c0317dcb5bf42
Diffstat (limited to 'src/nvim/shada.c')
-rw-r--r-- | src/nvim/shada.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/shada.c b/src/nvim/shada.c index 658cd1ba46..6bbf91e0f9 100644 --- a/src/nvim/shada.c +++ b/src/nvim/shada.c @@ -856,13 +856,13 @@ static int msgpack_sd_writer_write(void *data, const char *buf, size_t len) return 0; } -/// Check whether writing to shada file was disabled with -i NONE +/// Check whether writing to shada file was disabled ("-i NONE" or "--clean"). /// /// @return true if it was disabled, false otherwise. static bool shada_disabled(void) FUNC_ATTR_PURE { - return used_shada_file != NULL && STRCMP(used_shada_file, "NONE") == 0; + return strequal(p_shadafile, "NONE"); } /// Read ShaDa file @@ -1542,14 +1542,14 @@ static char *shada_filename(const char *file) FUNC_ATTR_MALLOC FUNC_ATTR_NONNULL_RET FUNC_ATTR_WARN_UNUSED_RESULT { if (file == NULL || *file == NUL) { - if (used_shada_file != NULL) { - file = used_shada_file; + if (p_shadafile != NULL) { + file = p_shadafile; } else { if ((file = find_shada_parameter('n')) == NULL || *file == NUL) { file = shada_get_default_file(); } // XXX It used to be one level lower, so that whatever is in - // `used_shada_file` was expanded. I intentionally moved it here + // `p_shadafile` was expanded. I intentionally moved it here // because various expansions must have already be done by the shell. // If shell is not performing them then they should be done in main.c // where arguments are parsed, *not here*. |