Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Replace viminfo with ShaDa files #2506

Merged
merged 136 commits into from
Oct 16, 2015
Merged

[RFC] Replace viminfo with ShaDa files #2506

merged 136 commits into from
Oct 16, 2015

Conversation

ZyX-I
Copy link
Contributor

@ZyX-I ZyX-I commented Apr 25, 2015

This PR contains replacement for the viminfo file discussed in #999.

  • ShaDa file dumping.
  • Merging.
  • Writing.
    • Registers.
    • History item.
    • Last search/substitute pattern.
    • Last substitute replacement string.
    • Variable values.
    • Global marks.
    • Local marks.
    • Jump list.
    • Buffer list.
    • Buffer change list.
  • Reading.
    • Registers.
    • History item.
    • Last search/substitute pattern.
    • Last substitute replacement string.
    • Variable values.
    • Global marks.
    • Local marks.
    • Jump list.
    • Buffer list.
    • Buffer change list.
    • v:old_files list (is determined based on marks in shada, so has no equivalent in “writing section”).
  • Functional tests.
    • Registers.
    • History item.
    • Last search/substitute pattern.
    • Last substitute replacement string.
    • Global marks.
    • Local marks.
    • Jump list.
    • Buffer list.
    • Buffer change list.
    • Compatibility support:
      • Ignoring global marks with unknown names when reading.
      • Ignoring local marks with unknown names when reading.
      • Ignoring registers with unknown names when reading.
      • Ignoring registers with unknown types when reading.
      • Ignoring history with unknown type when reading.
      • Preserving global marks with unknown names when merging.
      • Preserving local marks with unknown names when merging.
      • Preserving registers with unknown names when merging.
      • Preserving registers with unknown types when merging.
      • Preserving history with unknown type when merging.
      • Preserving items with unknown type when merging.
      • Preserving additional_data/additional_elements in
        • Registers.
        • History items.
        • Last search/substitute patterns.
        • Last substitute replacement string.
        • Global marks.
        • Local marks.
        • Jump list.
        • Buffer list.
        • Buffer change list.
    • Variable values.
    • v:old_files list.
    • Merging:
      • History merging:
        • Ignoring read history item if NeoVim instance already contains its own with ge timestamp when reading.
        • Using read history item if NeoVim instance already contains its own with lt timestamp when reading.
        • Ignoring read history item if NeoVim instance already contains its own with ge timestamp when writing.
        • Using read history item if NeoVim instance already contains its own with lt timestamp when writing.
        • Reading history correctly with messed up timestamp order.
        • Writing history correctly with messed up timestamp order.
      • Replacing last search/substitute pattern with an older one when reading.
      • Replacing last search/substitute pattern with read one when reading with bang.
      • Replacing last search/substitute pattern with an older one when writing.
      • Replacing replacement string with an older one when reading.
      • Replacing replacement string with read one when reading with bang.
      • Replacing replacement string with an older one when writing.
      • Merging jump list when reading.
      • Merging jump list when writing.
      • Merging change list when reading.
      • Merging change list when writing.
      • Replacing global mark with an older one when reading.
      • Replacing global mark with read one when reading with bang.
      • Replacing global mark with an older one when writing.
      • Replacing local mark with an older one when reading.
      • Replacing local mark with read one when reading with bang.
      • Replacing local mark with an older one when writing.
      • Replacing register with an older one when reading.
      • Replacing register with read one when reading with bang.
      • Replacing register with an older one when writing.
    • Ignoring existing file when writing with bang.
    • Converting some data from &encoding when writing:
      • Converting register values when writing.
      • Converting variable values when writing.
      • Converting history strings when writing.
      • Converting last used search/substitute patterns when writing.
      • Converting last used replacement strings when writing.
    • Converting some data to &encoding when reading:
      • Converting register values when writing.
      • Converting variable values when writing.
      • Converting history strings when writing.
      • Converting last used search/substitute patterns when writing.
      • Converting last used replacement strings when writing.
    • Reaction on various errors in ShaDa file:
      • Items with invalid header.
      • Registers.
      • History items.
      • Last search/substitute patterns.
      • Last substitute replacement string.
      • Global marks.
      • Local marks.
      • Jump list.
      • Buffer list.
      • Buffer change list.
      • Variables.
    • s item size limit.
    • s item size limit being used when merging for “foreign” items.
    • Using .tmp.b when .tmp.a already exists.
    • Using .tmp.z when .tmp.a.tmp.x already exist.
    • Leaving temporary file when there was error in target file.
    • Failing when .tmp.a.tmp.z files exist.
    • Positive fixnum timestamp being read correctly.
    • Uint8 timestamp being read correctly.
    • Uint16 timestamp being read correctly.
    • Uint32 timestamp being read correctly.
    • Uint64 timestamp being read correctly.
  • Documentation update.
  • Converting some data from &encoding when writing.
  • Converting some data to &encoding when reading.
  • Safer variant of dumping viminfo (dump to temporary file then rename).
  • Removing old viminfo code (currently masked with #if 0 in a ShaDa file for
    reference).
  • Fixing linter errors.
  • Fixing existing failing tests.

@ZyX-I ZyX-I added the WIP label Apr 25, 2015
@ZyX-I ZyX-I added this to the first release milestone Apr 25, 2015
@ZyX-I ZyX-I force-pushed the shada branch 4 times, most recently from 938455a to a3fd0ac Compare April 25, 2015 23:45
@@ -7458,7 +7462,7 @@ A jump table for the options with a short description can be found at |Q_op|.
edited.
<1000 Contents of registers (up to 1000 lines each) will be
remembered.
s100 Registers with more than 100 Kbyte text are skipped.
s100 Items occupying more then 102 400 bytes are skipped.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

102 400 is very unusual in U.S. 100 KiB would be better.

@ZyX-I ZyX-I force-pushed the shada branch 4 times, most recently from 6d635a1 to e2c374b Compare May 1, 2015 20:35
@ZyX-I ZyX-I force-pushed the shada branch 2 times, most recently from 1824689 to 657ca52 Compare May 14, 2015 19:32
@fmoralesc fmoralesc mentioned this pull request May 17, 2015
40 tasks
@ZyX-I ZyX-I force-pushed the shada branch 12 times, most recently from 3e385c3 to 48a4399 Compare July 4, 2015 23:33
@ZyX-I ZyX-I force-pushed the shada branch 2 times, most recently from 02e11d1 to 271b1c2 Compare July 5, 2015 14:20
It leads to a memory leak as well. May overwrite wms->jumps_size.
Problem that led to this skip was fixed in [neovim#3309][1].

[1]: neovim@0a116c8
Errors happens under following conditions:

1. Jump/change list is full.
2. New jump/change list item should go between some of the old ones.
- Remove unused variables.
- Do not use helpers.nvim_feed in most cases.
- Do not use helpers.nvim and helpers.nvim_eval at all.
- Add helpers.funcs and helpers.\*meths special tables. Indexing such table 
  creates functions which call helpers.call or helpers.nvim (and similar) with 
  first argument equal to table index.
@ZyX-I
Copy link
Contributor Author

ZyX-I commented Oct 8, 2015

They currently cost only one redirect in help file, which will hopefully cause user to review his settings. By the time deprecated option and commands are removed I expect ShaDa files be more useful then currently: specifically this format was designed also to make it possible to have zsh-style history sharing options somewhere in the future which were mentioned in #999.

justinmk added a commit that referenced this pull request Oct 16, 2015
Replace viminfo with ShaDa files
@justinmk justinmk merged commit 3a970e5 into neovim:master Oct 16, 2015
@justinmk justinmk removed the RFC label Oct 16, 2015
@justinmk
Copy link
Member

@ZyX-I Merged this so that it can bake for ~1 week before 0.1. This is a great enhancement. Also thank you @oni-link for reviewing.

@fmoralesc
Copy link
Contributor

👍 Congrats, everyone!

@tarruda
Copy link
Member

tarruda commented Oct 16, 2015

👍 great work

@jszakmeister
Copy link
Contributor

Awesome job guys!!

@Eriner
Copy link

Eriner commented Oct 16, 2015

👍 great job!

@ZyX-I ZyX-I deleted the shada branch October 16, 2015 16:15
@ghost ghost mentioned this pull request Oct 16, 2015
@ZyX-I ZyX-I mentioned this pull request Oct 17, 2015
@neovim neovim locked and limited conversation to collaborators Oct 31, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants