Skip to content

Commit

Permalink
shada: Add generator key to the header
Browse files Browse the repository at this point in the history
For use in viminfo→shada converters, plugins that allow editing ShaDa files or 
any other software which generates ShaDa files for whatever purpose.
  • Loading branch information
ZyX-I committed Aug 18, 2015
1 parent 4921498 commit 882e874
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
13 changes: 9 additions & 4 deletions runtime/doc/starting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "NeoVim" when ShaDa file
was written by NeoVim.

This comment has been minimized.

Copy link
@justinmk

justinmk Aug 18, 2015

Should be Neovim (or neovim), not NeoVim, unless we are going to change literally all of our other materials.

This comment has been minimized.

Copy link
@ZyX-I

ZyX-I Aug 18, 2015

Author Owner

I see that in documentation there are the following variants:

  1. Most common is neovim. Actually only because of identifiers like @neovim, pip install, links. There are exactly no occasions where neovim is used in documentation not as identifier.
  2. Second most is NeoVim, but only because of my additions to starting.txt. Not present anywhere else.
  3. Neovim is almost never used. I saw only two occasions, and one at the start of the sentense.

Thus I would say that in runtime/doc neovim is almost never referenced: I found only two Neovim string instances which are both not identifiers and were not added by me.

Doxygen docstrings mostly reference Neovim, but there are only 19 places. In fact I have added 10 references here.

This comment has been minimized.

Copy link
@justinmk

justinmk Aug 18, 2015

@ZyX-I The reason for those results is that we avoid all forms of "neovim" in technical/source code competely, preferring nvim and NVIM where possible. Even in user docs, we prefer Nvim where possible. Ideally for your generator name, I suggest nvim, but if you prefer "neovim", then it's better to avoid the NeoVim capitalization which is explicitly not used in any of our materials (in particular, http://neovim.io). (Any cases where it is used, will need to be corrected)

For better or worse, "Neovim" was the agreed capitalization in neovim#149

This comment has been minimized.

Copy link
@ZyX-I

ZyX-I Aug 18, 2015

Author Owner

I have replaced this with Neovim in all my docs, also generator is now named after the executable.

This comment has been minimized.

Copy link
@ZyX-I

ZyX-I Aug 18, 2015

Author Owner

* after the standard executable name, not argv[0]. I did not think this is a good idea because this is easy to fake.

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
Expand Down
6 changes: 4 additions & 2 deletions src/nvim/shada.c
Original file line number Diff line number Diff line change
Expand Up @@ -2419,9 +2419,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("NeoVim")) },
{ STATIC_CSTR_AS_STRING("version"),
STRING_OBJ(cstr_as_string(longVersion)) },
{ STATIC_CSTR_AS_STRING("max_kbyte"),
Expand Down

0 comments on commit 882e874

Please sign in to comment.