aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_cmds.lua16
-rw-r--r--src/nvim/ex_docmd.c6
-rw-r--r--src/nvim/fileio.c2
-rw-r--r--src/nvim/globals.h2
-rw-r--r--src/nvim/option.c6
-rw-r--r--src/nvim/option_defs.h2
-rw-r--r--src/nvim/options.lua8
-rw-r--r--src/nvim/shada.c14
-rw-r--r--src/nvim/testdir/test8.in2
9 files changed, 39 insertions, 19 deletions
diff --git a/src/nvim/ex_cmds.lua b/src/nvim/ex_cmds.lua
index 5221554306..77f7dba81b 100644
--- a/src/nvim/ex_cmds.lua
+++ b/src/nvim/ex_cmds.lua
@@ -2120,6 +2120,12 @@ return {
func='ex_wrongmodifier',
},
{
+ command='rshada',
+ flags=bit.bor(BANG, FILE1, TRLBAR, CMDWIN),
+ addr_type=ADDR_LINES,
+ func='ex_shada',
+ },
+ {
command='runtime',
flags=bit.bor(BANG, NEEDARG, FILES, TRLBAR, SBOXOK, CMDWIN),
addr_type=ADDR_LINES,
@@ -2153,7 +2159,7 @@ return {
command='rviminfo',
flags=bit.bor(BANG, FILE1, TRLBAR, CMDWIN),
addr_type=ADDR_LINES,
- func='ex_viminfo',
+ func='ex_shada',
},
{
command='substitute',
@@ -3032,6 +3038,12 @@ return {
func='ex_wsverb',
},
{
+ command='wshada',
+ flags=bit.bor(BANG, FILE1, TRLBAR, CMDWIN),
+ addr_type=ADDR_LINES,
+ func='ex_shada',
+ },
+ {
command='wundo',
flags=bit.bor(BANG, NEEDARG, FILE1),
addr_type=ADDR_LINES,
@@ -3041,7 +3053,7 @@ return {
command='wviminfo',
flags=bit.bor(BANG, FILE1, TRLBAR, CMDWIN),
addr_type=ADDR_LINES,
- func='ex_viminfo',
+ func='ex_shada',
},
{
command='xit',
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 3e0a2c1076..666431438e 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -9140,16 +9140,16 @@ int put_line(FILE *fd, char *s)
}
/*
- * ":rviminfo" and ":wviminfo".
+ * ":rshada" and ":wshada".
*/
-static void ex_viminfo(exarg_T *eap)
+static void ex_shada(exarg_T *eap)
{
char_u *save_shada;
save_shada = p_shada;
if (*p_shada == NUL)
p_shada = (char_u *)"'100";
- if (eap->cmdidx == CMD_rviminfo) {
+ if (eap->cmdidx == CMD_rviminfo || eap->cmdidx == CMD_rshada) {
if (shada_read_everything((char *) eap->arg, eap->forceit) == FAIL)
EMSG(_("E195: Cannot open ShaDa file for reading"));
} else {
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 38442e3ab3..a7472b40e2 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -2177,7 +2177,7 @@ static void check_marks_read(void)
shada_read_marks();
}
- /* Always set b_marks_read; needed when 'viminfo' is changed to include
+ /* Always set b_marks_read; needed when 'shada' is changed to include
* the ' parameter after opening a buffer. */
curbuf->b_marks_read = true;
}
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index 4ad0d2ec90..146109a414 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -892,7 +892,7 @@ EXTERN int skip_redraw INIT(= FALSE); /* skip redraw once */
EXTERN int do_redraw INIT(= FALSE); /* extra redraw once */
EXTERN int need_highlight_changed INIT(= TRUE);
-EXTERN char *used_shada_file INIT(= NULL); /* name of viminfo file to use */
+EXTERN char *used_shada_file INIT(= NULL); /* name of ShaDa file to use */
#define NSCRIPT 15
EXTERN FILE *scriptin[NSCRIPT]; /* streams to read script from */
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 87bae0179c..3f90293e19 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -1738,7 +1738,7 @@ set_options_bin (
/*
* Find the parameter represented by the given character (eg ', :, ", or /),
- * and return its associated value in the 'viminfo' string.
+ * and return its associated value in the 'shada' string.
* Only works for number parameters, not for 'r' or 'n'.
* If the parameter is not specified in the string or there is no following
* number, return -1.
@@ -1755,7 +1755,7 @@ int get_shada_parameter(int type)
/*
* Find the parameter represented by the given character (eg ''', ':', '"', or
- * '/') in the 'viminfo' option and return a pointer to the string after it.
+ * '/') in the 'shada' option and return a pointer to the string after it.
* Return NULL if the parameter is not specified in the string.
*/
char_u *find_shada_parameter(int type)
@@ -2442,7 +2442,7 @@ did_set_string_option (
if (*p_vfile != NUL && verbose_open() == FAIL)
errmsg = e_invarg;
}
- /* 'viminfo' */
+ /* 'shada' */
else if (varp == &p_shada) {
for (s = p_shada; *s; ) {
/* Check it's a valid character */
diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h
index a4cb390523..ab3169bff6 100644
--- a/src/nvim/option_defs.h
+++ b/src/nvim/option_defs.h
@@ -558,7 +558,7 @@ EXTERN long p_ur; /* 'undoreload' */
EXTERN long p_uc; /* 'updatecount' */
EXTERN long p_ut; /* 'updatetime' */
EXTERN char_u *p_fcs; /* 'fillchar' */
-EXTERN char_u *p_shada; /* 'viminfo' */
+EXTERN char_u *p_shada; /* 'shada' */
EXTERN char_u *p_vdir; /* 'viewdir' */
EXTERN char_u *p_vop; /* 'viewoptions' */
EXTERN unsigned vop_flags; /* uses SSOP_ flags */
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
index e66c46e08a..5973e4b938 100644
--- a/src/nvim/options.lua
+++ b/src/nvim/options.lua
@@ -1992,6 +1992,14 @@ return {
}}
},
{
+ full_name='shada', abbreviation='sd',
+ type='string', list='comma', scope={'global'},
+ deny_duplicates=true,
+ secure=true,
+ varname='p_shada',
+ defaults={if_true={vi="", vim="!,'100,<50,s10,h"}}
+ },
+ {
full_name='shell', abbreviation='sh',
type='string', scope={'global'},
secure=true,
diff --git a/src/nvim/shada.c b/src/nvim/shada.c
index c853b00bac..23a69f5bed 100644
--- a/src/nvim/shada.c
+++ b/src/nvim/shada.c
@@ -152,7 +152,7 @@ enum SRNIFlags {
| (1 << kSDItemSubString)
| (1 << kSDItemGlobalMark)
| (1 << kSDItemJump)
- ), ///< Data reading which cannot be disabled by &viminfo or other options
+ ), ///< Data reading which cannot be disabled by &shada or other options
///< except for disabling reading ShaDa as a whole.
kSDReadRegisters = (1 << kSDItemRegister), ///< Determines whether registers
///< should be read (may only be
@@ -163,11 +163,11 @@ enum SRNIFlags {
///< disabled by &history).
kSDReadVariables = (1 << kSDItemVariable), ///< Determines whether variables
///< should be read (disabled by
- ///< removing ! from &viminfo).
+ ///< removing ! from &shada).
kSDReadBufferList = (1 << kSDItemBufferList), ///< Determines whether buffer
///< list should be read
///< (disabled by removing
- ///< % entry from &viminfo).
+ ///< % entry from &shada).
kSDReadUnknown = (1 << (SHADA_LAST_ENTRY + 1)), ///< Determines whether
///< unknown items should be
///< read (usually disabled).
@@ -175,7 +175,7 @@ enum SRNIFlags {
(1 << kSDItemLocalMark)
| (1 << kSDItemChange)
), ///< Determines whether local marks and change list should be read. Can
- ///< only be disabled by disabling &viminfo or putting '0 there.
+ ///< only be disabled by disabling &shada or putting '0 there.
};
// Note: SRNIFlags enum name was created only to make it possible to reference
// it. This name is not actually used anywhere outside of the documentation.
@@ -1029,8 +1029,8 @@ static void shada_read(ShaDaReadDef *const sd_reader, const int flags)
/// Get the ShaDa file name to use
///
/// If "file" is given and not empty, use it (has already been expanded by
-/// cmdline functions). Otherwise use "-i file_name", value from 'viminfo' or
-/// the default, and expand environment variables.
+/// cmdline functions). Otherwise use "-i file_name", value from 'shada' or the
+/// default, and expand environment variables.
///
/// @param[in] file Forced file name or NULL.
///
@@ -3013,7 +3013,7 @@ static ShadaEntry *list_buffer_marks(const buf_T *const buf)
return ret;
}
-/// Check whether "name" is on removable media (according to 'viminfo')
+/// Check whether "name" is on removable media (according to 'shada')
///
/// @param[in] name Checked name.
///
diff --git a/src/nvim/testdir/test8.in b/src/nvim/testdir/test8.in
index 0f27c813ec..41e6262e92 100644
--- a/src/nvim/testdir/test8.in
+++ b/src/nvim/testdir/test8.in
@@ -32,7 +32,7 @@ endfunc
$put ='VimLeave done'
write
endfunc
-:set viminfo='100
+:set shada='100
:au BufUnload * call CloseAll()
:au VimLeave * call WriteToOut()
:e small.vim