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

Conversation

Projects
None yet
9 participants
@ZyX-I
Copy link
Contributor

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 ZyX-I:shada branch 4 times, most recently from 938455a to a3fd0ac Apr 25, 2015

@@ -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.

This comment has been minimized.

@justinmk

justinmk Apr 26, 2015

Member

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

@ZyX-I ZyX-I force-pushed the ZyX-I:shada branch 4 times, most recently from 6d635a1 to e2c374b Apr 26, 2015

@ZyX-I ZyX-I force-pushed the ZyX-I:shada branch 2 times, most recently from 1824689 to 657ca52 May 14, 2015

@fmoralesc fmoralesc referenced this pull request May 17, 2015

Closed

[Discussion/Tracking] Defaults #2676

37 of 40 tasks complete

@ZyX-I ZyX-I force-pushed the ZyX-I:shada branch 12 times, most recently from 3e385c3 to 48a4399 Jun 28, 2015

@ZyX-I ZyX-I force-pushed the ZyX-I:shada branch 2 times, most recently from 02e11d1 to 271b1c2 Jul 5, 2015

ZyX-I added some commits Aug 28, 2015

shada: Fix out-of-bounds array access
It leads to a memory leak as well. May overwrite wms->jumps_size.
functests: Do not disable pattern tests
Problem that led to this skip was fixed in [#3309][1].

[1]: 0a116c8
shada: Fix jump/change list merging code
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.
functests: Refactor tests:
- 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

This comment has been minimized.

Copy link
Contributor

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.

@ZyX-I ZyX-I force-pushed the ZyX-I:shada branch from 159dc90 to db6cba7 Oct 8, 2015

justinmk added a commit that referenced this pull request Oct 16, 2015

Merge pull request #2506 from ZyX-I/shada
Replace viminfo with ShaDa files

@justinmk justinmk merged commit 3a970e5 into neovim:master Oct 16, 2015

3 checks passed

continuous-integration/appveyor AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.8%) to 67.919%
Details

@justinmk justinmk removed the RFC label Oct 16, 2015

@justinmk

This comment has been minimized.

Copy link
Member

justinmk commented Oct 16, 2015

@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

This comment has been minimized.

Copy link
Contributor

fmoralesc commented Oct 16, 2015

👍 Congrats, everyone!

@tarruda

This comment has been minimized.

Copy link
Member

tarruda commented Oct 16, 2015

👍 great work

@jszakmeister

This comment has been minimized.

Copy link
Member

jszakmeister commented Oct 16, 2015

Awesome job guys!!

@Eriner

This comment has been minimized.

Copy link

Eriner commented Oct 16, 2015

👍 great job!

@ZyX-I ZyX-I deleted the ZyX-I:shada branch Oct 16, 2015

@ghost ghost referenced this pull request Oct 16, 2015

Closed

[RFC] nvim.1: bump date #3465

@ZyX-I ZyX-I referenced this pull request Oct 17, 2015

Closed

[WIP] XDG support #3198

@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.