aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/shada.c
Commit message (Collapse)AuthorAge
...
* shada: Refactor code that works with hms.last_hist_entryZyX2015-10-08
|
* documentation/functests: Replace NeoVim with NeovimZyX2015-10-08
|
* shada: Add generator key to the headerZyX2015-10-08
| | | | | For use in viminfo→shada converters, plugins that allow editing ShaDa files or any other software which generates ShaDa files for whatever purpose.
* shada: Use same iteration end conditions as with other iteratorsZyX2015-10-08
|
* shada: Also expand file name obtained from &shada optionZyX2015-10-08
|
* *: Fix problems with clang+asan Release buildZyX2015-10-08
|
* shada: Refuse to write ShaDa file when ShaDa was disabledZyX2015-10-08
|
* config: Check order and endianess even when cross-compilingZyX2015-10-08
|
* shada,config: Use CMake to determine endianess and be64toh existenceZyX2015-10-08
|
* shada: Fix crash in hmll_insertZyX2015-10-08
| | | | | | | | | | | | | | | | | This problem made test64 to crash. Description of the bug: when removing entry from history when removed entry is not the last one it puts one element to free_entries list, but ignores free entries starting from last_free_element. Possible solutions: 1. First working: simply populate free_entries list with entries which are still free, starting from last_free_element. 2. Better (wastes less CPU): after free_entries list size goes to zero (which is the initial value) continue using last_free_element. 3. Even better (less memory): note that element from the list is *only* removed before adding another one. So replace free_entries array with one item. Also renamed last_free_element to last_free_entry: in any case most of the lines which mention it were altered.
* shada: Fix -Wstrict-aliasing gcc errorZyX2015-10-08
| | | | | Also removes theoretically possible unaligned memory access when computing be64toh() argument.
* shada: Fix unused variable warning when using Release buildZyX2015-10-08
|
* shada: Fix incompatible pointer types error in non-glibc buildsZyX2015-10-08
|
* shada: Avoid “conditional … depends on initialized value” errorZyX2015-10-08
| | | | Error can be seen in some errors_spec.lua tests.
* shada: Allow moving jump index past the endZyX2015-10-08
| | | | idx == len + 1 indicates that no jumplist entry is currently used.
* shada: Use same merging code for jumps and changesZyX2015-10-08
|
* shada: Move common jump/change merging code into a macrosZyX2015-10-08
|
* shada: Fix jump list merger codeZyX2015-10-08
|
* shada: Move all default values to an array of ShadaEntry structsZyX2015-10-08
|
* shada: Fix linter errorsZyX2015-10-08
|
* shada,functests: Add tests for merging ShaDa dataZyX2015-10-08
|
* shada: Merge changes regardless whether they are from current instanceZyX2015-10-08
|
* shada,functests: Make sure that v:oldfiles list is reset on :rshada!ZyX2015-10-08
|
* shada: Always use merging when reading jumps and changesZyX2015-10-08
|
* shada: Call regtilde when reading last replacement stringZyX2015-10-08
|
* shada: Use hash for searching for history entriesZyX2015-10-08
|
* shada: Allocate all hashes on stackZyX2015-10-08
|
* shada,functests: Use special sd_reader function for skippingZyX2015-10-08
|
* shada: Add warning about removing/renaming temporary fileZyX2015-10-08
|
* shada,functests: Improve detection of invalid ShaDa filesZyX2015-10-08
| | | | | | | | | | | | | | | | It appears that large portion of non-ShaDa ASCII text files may be parsed as a ShaDa file because it is mostly recognized as a sequence of unknown entries: all ASCII non-control characters are recognized as FIXUINT shada objects, so text like #!/bin/sh powerline "$@" 2>&1 | tee -a powerline (with trailing newline) will be recognized as a correct ShaDa file containing single unknown entry with type 0x23 (dec 35, '#'), timestamp 0x21 (dec 33, '!') and length 0x2F (dec 47, '/') without this commit. With it parsing this entry will fail.
* shada: When packing header, pack mapping keys as strings, not binaryZyX2015-10-08
|
* shada,functests: Test compatibility supportZyX2015-10-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For compatibility the following things are done: 1. Items with type greater then greatest type are ignored when reading and copied when writing. 2. Registers with unknown name are ignored when reading and blindly copied when writing. 3. Registers with unknown type are ignored when reading and merged as usual when writing. 4. Local and global marks with unknown names are ignored when reading. When writing global marks are blindly copied and local marks are also blindly copied, but only if file they are attached to fits in the `'N` limit defined in &shada. Unknown local mark’s timestamp is also taken into account when calculating which files exactly should fit into this limit. 5. History items with unknown type are ignored when reading and blindly copied when writing. 6. Unknown keys found in register, local marks, global marks, changes, jumps and search pattern entries are read to additional_data Dictionary and dumped (of course, unless any of these elements were not overwritten later). It obviously works only for values conversible to Object type. 7. Additional elements found in replacement string and history entries are read to additional_elements Array and dumped (same: only if they were not overwritten later). Again this works only for elements conversible to Object type. 8. Additional elements found in variable entries are simply ignored when reading. When writing *new* variables they will be preserved during merging, but that’s all. Variable values dumped from current NeoVim session never have additional elements.
* shada: Fix GCC -Wconversion warnings in srni_flags definitionsZyX2015-10-08
|
* shada: Synchronize sd_writer file before closingZyX2015-10-08
|
* shada: Do not allow empty keysZyX2015-10-08
|
* shada: When reading marks or registers, free items when set failsZyX2015-10-08
|
* *: Make ShaDa code use VimL values for additional_\* dataZyX2015-10-08
|
* shada,documentation: Extend read error handling, handle write errorsZyX2015-10-08
| | | | | | | | Modifications: - If file was not written due to write error then writing stops and temporary file will not be renamed. - If NeoVim detects that target file is not a ShaDa file then temporary file will not be renamed.
* shada,functests: Test how ShaDa support code reacts on errorsZyX2015-10-08
| | | | | | | | | | | | | | Some notes: - Replaced msgpack_unpacker usage with regular xmalloc’ed buffer. Also since msgpack_unpack_next (as well as msgpack_unpacker_next) is not ever going to return MSGPACK_UNPACK_EXTRA_BYTES this condition was checked manually. Function that does return this status is msgpack_unpack, but it is marked as obsolete. - Zero type is checked prior to main switch in shada_read_next_item because otherwise check would be skipped. - Zeroing entry at the start of shada_read_next_item makes it safer. - dedent('') does not work. - v:oldfiles list is only replaced with bang, if it is NULL or empty.
* shada: Make all mapping keys have at most 2 byte lengthZyX2015-10-08
| | | | Now all keys are defined in a way that makes it easy to redefine if needed.
* shada: Do not handle EINTR in open_fileZyX2015-10-08
| | | | It is already handled by libuv which is used by os_open.
* shada: Do not export shada_read_fileZyX2015-10-08
| | | | | Unlike some wrapper functions it is not used actually, so no need to export it. Also removed ShadaPosition typedef which was not used.
* shada: Translate errors and add error codesZyX2015-10-08
| | | | | | | | | | Notes: - E136 code greatly changed its meaning: now it is write error and not read error. - E195 was removed because shada_read_everything will already do all the necessary error reporting. - E886 can be reported by both :rshada and :wshada, but :rshada comes first and AFAIR it is the only error which is not E575 and can be reported by :rshada.
* shada: Only check errno if read/write returned -1ZyX2015-10-08
| | | | | | | According to the manual (POSIX) this is the only case when errno is set by these functions. This is needed because some functions (e.g. buflist_new) leave errno set to non-zero value under some conditions (e.g. when opening non-existing files).
* shada: Put pointer to the close function into reader/writer structureZyX2015-10-08
|
* shada: Handle all possible msgpack_unpacker_next returnsZyX2015-10-08
|
* viminfo: Remove old codeZyX2015-10-08
|
* shada: Add support for merging everything like described in the docZyX2015-10-08
|
* shada: Do not copy history entries when writingZyX2015-10-08
|
* shada: Do not save search pattern/sub string when it is olderZyX2015-10-08
|