aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/starting.txt13
-rw-r--r--src/nvim/shada.c10
2 files changed, 14 insertions, 9 deletions
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index dfb80b7f98..2078e9761b 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -1182,14 +1182,19 @@ exactly four MessagePack objects:
entry type:
Entry type (name) Entry data ~
- 1 (Header) Map containing data that describes the NeoVim instance
- that written this ShaDa file. It is ignored when
- reading ShaDa files. Contains the following data:
+ 1 (Header) Map containing data that describes the generator
+ instance that wrote this ShaDa file. It is ignored
+ when reading ShaDa files. Contains the following data:
Key Data ~
- version Binary, NeoVim version.
+ generator Binary, software used to generate ShaDa
+ file. Is equal to "nvim" when ShaDa file was
+ written by NeoVim.
+ version Binary, generator version.
encoding Binary, effective 'encoding' value.
max_kbyte Integer, effective |shada-s| limit value.
pid Integer, instance process ID.
+ * It is allowed to have any number of
+ additional keys with any data.
2 (SearchPattern) Map containing data describing last used search or
substitute pattern. Normally ShaDa file contains two
such entries: one with "ss" key set to true (describes
diff --git a/src/nvim/shada.c b/src/nvim/shada.c
index 76ae82e309..322f485f48 100644
--- a/src/nvim/shada.c
+++ b/src/nvim/shada.c
@@ -2418,9 +2418,11 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer,
.timestamp = os_time(),
.data = {
.header = {
- .size = 4,
- .capacity = 4,
+ .size = 5,
+ .capacity = 5,
.items = ((KeyValuePair[]) {
+ { STATIC_CSTR_AS_STRING("generator"),
+ STRING_OBJ(STATIC_CSTR_AS_STRING("nvim")) },
{ STATIC_CSTR_AS_STRING("version"),
STRING_OBJ(cstr_as_string(longVersion)) },
{ STATIC_CSTR_AS_STRING("max_kbyte"),
@@ -2605,9 +2607,7 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer,
continue;
}
const char *const fname = (char *) (fm.fmark.fnum == 0
- ? (fm.fname == NULL
- ? NULL
- : fm.fname)
+ ? (fm.fname == NULL ? NULL : fm.fname)
: buf->b_ffname);
if (fname == NULL) {
continue;