aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/shada.c
Commit message (Collapse)AuthorAge
* shada: Move '%' handling from shada_write to its own functionJames McCoy2016-12-14
| | | | | shada_get_buflist finds all the relevant buffers and generates the kSDItemBufferList ShadaEntry.
* shada: Respect the optional buffer count for shada-%James McCoy2016-12-12
| | | | Closes #5759
* Avoid serializing NULL string through msgpackJames McCoy2016-11-23
| | | | | | Attempting to serialize a NULL string through msgpack results in msgpack_sbuffer_write attempting to memcpy from a NULL pointer, which is undefined behavior.
* refactor: eliminate misc2.cJustin M. Keyes2016-09-13
| | | | | | | | | | move `call_shell` to misc1.c Move some fns to state.c Move some fns to option.c Move some fns to memline.c Move `vim_chdir*` fns to file_search.c Move some fns to new module, bytes.c Move some fns to fileio.c
* shada: Fix non-writeable ShaDa directory handlingZyX2016-09-04
| | | | | | | | | | | | | Before this change, nvim -i /etc/shada segfaults on exit if the file does not exist and user does not have permissions to create the file at /etc/shada. Closes #5296 Reported in #5277 https://github.com/neovim/neovim/issues/5277#issuecomment-243937255
* option: Also escape commas in options other then &runtimepathZyX2016-07-10
|
* *: Satisfy linter (newest type casts rule)ZyX2016-06-24
|
* file: Move src/nvim/file.* to src/nvim/os/fileio.*ZyX2016-06-24
|
* shada: Do not forget to close ShaDa readerZyX2016-06-23
| | | | | | | | | Previously there was file descriptor leak, not detected by sanitizers. Now it is file descriptor leak with a small memory leak which is detected by ASAN what fails one of the tests (actually, “ShaDa support code leaves .tmp.z in-place when there is error in original ShaDa and it has .tmp.a … .tmp.x”, but error is reported at the next test because leaks are not detected until Neovim exit and Neovim exit happens when clear()/reset() is called which happens in before_each only).
* file: Use own constants, do not rely on fcntl.hZyX2016-06-23
| | | | | | | One of the reasons is that O_RDONLY is zero, which makes checking whether file is opened read- or write-only harder. It is not guaranteed that on other system O_WRONLY will not be zero (e.g. because file can only be opened in read-write mode).
* file: Add buffered reading and writingZyX2016-06-23
| | | | Still no busted tests. Not tested without HAVE_PREADV.
* file,os/fs,shada: Separate opening, closing, writing and reading filesZyX2016-06-23
| | | | | | | | Moves low-level functions handling to os/fs.c. Adds file.c with a proxy interface. Target: while leaving syscalls handling is os.c (partially handled by libuv), add buffering for reading and writing to file.c.
* ops.c: enable -Wconversion warningCharles Joachim2016-05-30
|
* Fix be64toh() detection on BSDs.John Szakmeister2016-05-14
| | | | | | | | | | | | | | | | This was noticed due to a user issue (#4750) when building Neovim 0.1.4 via ports. The crux of the issue is that we did not detect the be64toh() macro, because there is no endian.h on FreeBSD (along with several other BSDs). So we were defaulting to our builtin version of be64toh(). However, it appears that sys/endian.h was being picked up by an include (likely msgpack.h) and so be64toh() was actually defined and corrupting our definition of it. So the answer here was to use the correct include file in our check, and export that information in the config.h. Then we use that information to include the right header in shada.c. This fixes #4750.
* normal: convert MCHAR etc operator and register types to enum MotionTypeBjörn Linse2016-05-01
|
* message: Remove useless emsg* functions, leaving only emsgfZyX2016-04-18
|
* shada: Make sure that NIL and EXT values can also be parsed backZyX2016-04-18
| | | | | | | | | Note: currently they are both *dumped*, but parsing them produces an error. This is inappropriate: variables should either be skipped with error message when dumping or should be read back properly. It also appears that I did not have test for “has wrong variable value type” error, so nothing got removed from errors_spec.
* eval: Move some decoding functions to eval/decode.cZyX2016-04-18
|
* eval: Move encode.c to eval/encode.cZyX2016-04-18
|
* eval: Split out typval_T dumping functions to nvim/encode.cZyX2016-04-18
|
* config: Remove HAVE_UNISTD_H.Seth Jackson2016-01-18
| | | | | | | | | Unix systems must have this header but Windows does not have it at all. Since src/nvim/os/unix_defs.h includes <unistd.h> without the guard in order to avoid including this in the numerous places we would need <unistd.h> on Unix we just include src/nvim/os/os.h which will pull in <unistd.h> for us.
* Windows: Include <fcntl.h> for file constants.Seth Jackson2016-01-17
| | | | | | This header is required by POSIX for the constants (O_RDONLY, etc.) but we were only including it on Unix systems as a side effect of including <unistd.h>.
* Revert ROOT_UID removalMichael Reed2016-01-15
| | | | | | It helps clarify intent for those unaware of root's UID. see https://github.com/neovim/neovim/pull/4015#discussion_r49822371
* Misc. macro cleanupMichael Reed2016-01-14
| | | | | | | | | | - ROOT_UID's comment is misleading, as it's always defined to 0. - SEEK_{SET,END} & O_NOFOLLOW should already be defined on Unix-like systems in <stdio.h> and <fcntl.h>, respectively. In any case, neither of those #ifdef blocks should be in the middle of source files. - The S_IS{LNK,DIR,...} macros should only be undefined on Windows.
* shada.c: Fix HAVE_BE64TOH checkMichael Reed2016-01-13
| | | | | | | | | | | | | | Mentioned here: https://github.com/neovim/neovim/pull/3985#issuecomment-170663426 HAVE_BE64TOH is defined in `config/config.h', which is included by `vim.h'. Since the HAVE_BE64TOH check in `shada.c' is evaluated before `vim.h' is included, it always evaluates to false, meaning that be64toh() in shada.c is always used instead of the one in <endian.h>. Moving the HAVE_BE64TOH block to after where `vim.h' is included seems to fix the issue.
* eval: Use better error messages when failing to dump valuesZyX2016-01-04
| | | | | | | | | | | | | | | | | | | | | | | | Examples: let g:SR = [[]] call add(g:SR[0], g:SR) wshada " E952: Unable to dump variable g:SR: container references itself in index 0, index 0 let g:F = {'_TYPE': v:msgpack_types.map, '_VAL': [[{'abc': 1}, function("tr")]]} wshada " E951: Error while dumping variable g:F, key {'abc': 1} at index 0 from special map, key '': attempt to dump function reference " (no msgpack#string available) " E951: Error while dumping variable g:F, key {="abc": 1} at index 0 from special map, key '': attempt to dump function reference " (msgpack#string available) let g:F = {'_TYPE': v:msgpack_types.map, '_VAL': [[g:SR, function("tr")]]} wshada " E951: Error while dumping variable g:F, key [[[[{E724@0}]]]] at index 0 from special map, index 1: attempt to dump function reference call msgpackdump([g:SR]) " E952: Unable to dump msgpackdump() argument, index 0: container references itself in index 0, index 0 Not tested yet.
* Port fsync() to libuv.Seth Jackson2016-01-01
|
* shada: Free wms->hms in shada_write_exitZyX2015-12-18
| | | Otherwise there should be memory leak.
* shada: Continue dumping when variables failed to dumpZyX2015-12-18
| | | | Closes #3721
* shada: Fix all linter errors in src/nvim/shada.*ZyX2015-12-13
| | | | | This commit is an example of fixing incorrect code which previously passed through linter.
* Add missing guard for HAVE_UNISTD_HRui Abreu Ferreira2015-12-02
|
* Merge pull request #3724 from ZyX-I/fix-3635Justin M. Keyes2015-11-27
|\ | | | | shada: Do not save unlisted and quickfix buffers
| * shada: Do not save unlisted and quickfix buffersZyX2015-11-23
| | | | | | Fixes #3635
* | Update shada.c to use libuv error constants instead of errno constantsRui Abreu Ferreira2015-11-25
| | | | | | | | | | | | From #3473, shada.c used errno constants (e.g. ENOENT) to check the return of os_open(), but in Windows the return from libuv functions is not -errno. Instead use libuv error constants (e.g UV_ENOENT) for error checks.
* | shada: Also store last search directionZyX2015-11-23
|/ | | | | | | | | | Note: it looks like viminfo files do not store search direction intentionally. After reading viminfo file search direction was considered to be “forward”. Note 2: all files created on earlier Neovim version will automatically receive “forward” direction. Fixes #3580
* Merge pull request #3470 from ZyX-I/pr-3198Justin M. Keyes2015-10-25
|\ | | | | XDG base directory specification support
| * shada: Remove SHADA_FILE2ZyX2015-10-23
| |
| * option: Add `//` to the end of default `&directory`ZyX2015-10-23
| |
| * shada: Move shada file to a new locationZyX2015-10-23
| |
* | shada: Run set_last_cursor before writing shada fileZyX2015-10-23
|/
* shada: Do not use msgpack_rpc functions for converting data to msgpackZyX2015-10-08
| | | | Should protect against #3431
* shada: Fix shada_removable signatureZyX2015-10-08
|
* shada: Fix jump/change list merging codeZyX2015-10-08
| | | | | | 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.
* shada(documentation): Fix outdated commentsZyX2015-10-08
|
* shada: Make sure that shada-r option correctly ignores caseZyX2015-10-08
|
* shada: When using shada-r normalize option pathZyX2015-10-08
|
* shada: Fix out-of-bounds array accessZyX2015-10-08
| | | | It leads to a memory leak as well. May overwrite wms->jumps_size.
* shada: Save an allocation when writing local marksZyX2015-10-08
|
* shada: Fix v:hlsearch save/restore and do not write empty patternsZyX2015-10-08
|
* shada,functests: Fix v:hlsearch saving/restoring handlingZyX2015-10-08
|