Commit Graph

179 Commits

Author SHA1 Message Date
ZyX
ebf3c86a55 shada: Handle all possible msgpack_unpacker_next returns 2015-10-08 22:00:13 +03:00
ZyX
83785ef98b viminfo: Remove old code 2015-10-08 22:00:13 +03:00
ZyX
43fe98c9fb shada: Add support for merging everything like described in the doc 2015-10-08 22:00:13 +03:00
ZyX
4bc053facd shada: Do not copy history entries when writing 2015-10-08 22:00:12 +03:00
ZyX
f10960869f shada: Do not save search pattern/sub string when it is older 2015-10-08 22:00:12 +03:00
ZyX
9d2615df86 shada: Use os_strerror in place of strerror in some places 2015-10-08 22:00:11 +03:00
ZyX
09cbec6476 shada: Use os_mkdir_recurse to create directory for ShaDa file 2015-10-08 22:00:11 +03:00
ZyX
0018b4f579 shada: Refactor history merger to use statically sized 2linked list
Also fixes the error: when writing shada files existing history items may be
freed.

Warning: valgrind reports some memory leaks.
2015-10-08 22:00:10 +03:00
ZyX
6f6497f5e0 shada: Refactor history merging support to separate functions 2015-10-08 22:00:10 +03:00
ZyX
b905c8a942 shada: Preserve existing file permissions 2015-10-08 22:00:09 +03:00
ZyX
1d3823a5c9 shada: Populate v:oldfiles 2015-10-08 22:00:09 +03:00
ZyX
f43a5e6926 shada: Save v:hlsearch value 2015-10-08 22:00:08 +03:00
ZyX
45ad810341 shada: Add more size_t casts
As usual, GCC is overparanoid with -Wconversion.
2015-10-08 22:00:07 +03:00
ZyX
8663983cc4 Deprecate &viminfo and :[rw]v, add &shada and :[rw]sh 2015-10-08 22:00:07 +03:00
ZyX
9cf9c4a586 Replace references to viminfo in various places 2015-10-08 22:00:06 +03:00
ZyX
602efe856a shada: Use “write then rename” variant by default for writing shada 2015-10-08 22:00:05 +03:00
ZyX
55712dcdb4 shada: Test that history string does not contain zero byte
This test can safely be ignored for other kinds of strings, but history string
contains separator after the last NUL byte and string containing NUL byte inside
thus means that separator will be placed at one position, but seeked at
another.
2015-10-08 22:00:05 +03:00
ZyX
ee282cf49e shada: Add support for converting strings that are read or written 2015-10-08 21:59:57 +03:00
ZyX
98e8c1f37c shada: Refactor file reading/writing to use os_open 2015-10-08 21:59:56 +03:00
ZyX
d1ae27ceec shada,functests: Refactor shada items skipping 2015-10-08 21:59:56 +03:00
ZyX
941ec54aa1 shada: Reassign some entry types to WantInfo and WantMarks
kShaDaWantMarks now loads only local file change list and file-local marks.
kShaDaWantInfo now loads global marks and jump list.
2015-10-08 21:59:55 +03:00
ZyX
8c93877e1c shada: Add support for dumping and restoring buffer list 2015-10-08 21:59:55 +03:00
ZyX
4eeafe7f72 shada: Use pre-populated set of buffers on removable media
Should be faster then constantly running shada_removable for each buffer many
times.
2015-10-08 21:59:54 +03:00
ZyX
75c9a7e65b shada: Do not record removable buffers and marks 2015-10-08 21:59:54 +03:00
ZyX
200e62efeb shada: Add support for dumping/restoring bufs changes and win jumps 2015-10-08 21:59:53 +03:00
ZyX
0fe9679101 shada: Initial support for merging history
Currently only merges history when reading ShaDa file. No tests yet.
2015-10-08 21:59:53 +03:00
ZyX
94ed7ba03b shada: Skip reading some items if needed
Avoids unneeded malloc()s/free()s and lots of code for parsing.
2015-10-08 21:59:53 +03:00
ZyX
38c688d7be shada: Use glibc functions to convert from big endian, add a fallback 2015-10-08 21:59:51 +03:00
ZyX
244dbe3a77 viminfo: First version of ShaDa file dumping
What works:

1. ShaDa file dumping: header, registers, jump list, history, search patterns,
   substitute strings, variables.
2. ShaDa file reading: registers, global marks, variables.

Most was not tested.

TODO:

1. Merging.
2. Reading history, local marks, jump and buffer lists.
3. Documentation update.
4. Converting some data from &encoding.
5. Safer variant of dumping viminfo (dump to temporary file then rename).
6. Removing old viminfo code (currently masked with `#if 0` in a ShaDa file for
   reference).
2015-10-08 21:59:51 +03:00