| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
| |
Since 8b8ecf4, the shada module loads files in the jumplist to properly
clear duplicates. This can trigger some autocommands, which in turn
saves and restores search and substitute patterns, freeing the previous
strings in "spats" which are held in "wms" as well (heap-use-after-free).
To avoid this, initialize the jumplist in "wms" before search patterns.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Always load files when cleaning up jumplist.
- For Shada: avoids writing duplicate entries, which happens when you read
from a shada file with duplicate entries (merging the jumplist while
writing sometimes produces duplicate entries, bug?) and then write right
away (i.e.: without any `:jumps`, `getjumplist()`, or any jump movement,
that is: nothing that calls `cleanup_jumplist` with `loadfiles == true`).
- For Context: avoids non-idempotent behavior for the same reason (i.e.:
first call to `shada_encode_jumps` does not remove duplicate entries).
- Do not set pcmark when dumping jumplist for Context.
- Retrieving current Context shouldn't add an entry to the jumplist
(which will be removed by a subsequent `cleanup_jumplist` anyway, i.e.:
tail entry matching current position), just act like `getjumplist` for
instance.
|
|
|
|
|
|
|
| |
Problem: SET_NO_HLSEARCH() used in a wrong way.
Solution: Make it a function. (suggested by Dominique Pelle,
closes vim/vim#2850)
https://github.com/vim/vim/commit/451fc7b954906069f1830a8092ad85616049a828
|
|
|
|
|
|
| |
Problem: Terminal buffers are stored in the viminfo file while they can't
be useful.
Solution: Skip terminal buffers for file marks and buffer list
https://github.com/vim/vim/commit/e62780543f403186b27b210dd087dd8ba74159fc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Check shada_pack_xx() result, abort on failure.
- Use xcalloc() to zero-initialize `wms`, fixes below ASAN failure.
ASAN failure (running vim_spec.lua in a loop):
../src/nvim/shada.c:1773:13: runtime error: load of value 224, which is not a valid value for type 'bool'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/nvim/shada.c:1773:13
Adding an explicit check just before the ASAN failed line:
case kSDItemRegister: {
if (*((int *)(void *)&entry.data.reg.is_unnamed) != 1
&& *((int *)(void *)&entry.data.reg.is_unnamed) != 0) {
abort();
(gdb) p entry.data.reg
+p entry.data.reg
$5 = {name = 49 '1', type = kMTLineWise, contents = 0x60200000c250, is_unnamed = true, contents_size = 1, width = 0, additional_data = 0x0}
(gdb) p *((uint8_t *)(void *)&entry.data.reg.is_unnamed)
+p *((uint8_t *)(void *)&entry.data.reg.is_unnamed)
$7 = 2049
|
| |
|
|
|
|
|
|
|
|
| |
Problem: Clearing a pointer takes two lines.
Solution: Add VIM_CLEAR() and replace vim_clear(). (Hirohito Higashi,
closes #2629)
vim-patch:8.0.1481
|
|
|
|
|
|
| |
Problem: The jumplist is not always properly cleaned up.
Solution: Call fname2fnum() before cleanup_jumplist(). (Yegappan Lakshmanan)
https://github.com/vim/vim/commit/486797413791f6be12dcec6e5faf4f952e4647ae
|
|
|
|
|
|
| |
Problem: Getjumplist() returns duplicate entries. (lacygoill)
Solution: Call cleanup_jumplist(). (Yegappan Lakshmanan)
https://github.com/vim/vim/commit/a7e18d237f817637815f0de44b08df1e0ca0f4f9
|
|
|
|
|
| |
References https://github.com/neovim/neovim/pull/9907
Fixes https://github.com/neovim/neovim/issues/9912
|
|
|
|
|
|
|
|
|
|
|
|
| |
Nvim notes:
- Nvim does not support "-u DEFAULTS", that change is omitted.
- Also add 'shadafile' as an alias to 'viminfofile'.
- Deprecate 'viminfofile'.
Problem: Not easy to start Vim cleanly without changing the viminfo file.
Not possible to know whether the -i command line flag was used.
Solution: Add the --clean command line argument. Add the 'viminfofile'
option. Add "-u DEFAULTS".
https://github.com/vim/vim/commit/c4da113ef98dcfd6f2a088b1693c0317dcb5bf42
|
|
|
| |
fixes #9775
|
| |
|
|
|
|
|
| |
False positive: `i` is intentionally, temporarily reassigned.
See a70fde1b4585 #9425
|
|
|
|
|
|
|
|
|
|
| |
Note about shada.c:
- shada_read_next_item_start was intentionally shadowing `unpacked` and
`i` because many of the macros (e.g. ADDITIONAL_KEY) implicitly
depended on those variable names.
- Macros were changed to parameterize `unpacked` (but not `i`). Macros
like CLEAR_GA_AND_ERROR_OUT do control-flow (goto), so any other
approach is messy.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
log.c
message.c
strings.c
fixed some printf warnings in:
src/nvim/undo.c
src/nvim/eval.c
src/nvim/eval/encode.c
src/nvim/eval/typval.c
src/nvim/ex_getln.c
src/nvim/fileio.c
src/nvim/lua/executor.c
src/nvim/main.c
src/nvim/regexp_nfa.c
src/nvim/shada.c
src/nvim/spellfile.c
src/nvim/tui/terminfo.c
src/nvim/garray.h
|
|
|
|
|
|
|
| |
shada_write_file() is called on exit (:quit and friends), this can be
very slow.
Note: AFAICT Vim (do_viminfo()) does not appear to fsync() viminfo.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problems:
- In two places in shada_read_when_writing() memory just was not freed. Both
places were verified to cause test failures.
- Numbered marks got assigned incorrect (off-by-one compared to position in the
array) numbers in replace_numbered_mark.
- It was possible to have non-continuously populated array of numbered marks
which messed up code for merging them.
(Note about tests: marks with additional data are always compared different when
merging, that caused some confusion regarding why test did not work the way
I expected.)
|
|
|
| |
To be used in debugging printfs.
|
|
|
| |
Attempt to fix observed crash. Crash currently not reproduced.
|
|
|
|
| |
This reverts commit aa728798b4bd89b59cee86103885c15d386f73ba.
|
| |
|
|
|
|
|
| |
Based on https://github.com/neovim/neovim/pull/5908#issuecomment-375909903, but
with adjusted condition as line number or column less then zero should not
appear at all based on what I know.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Problems so far:
- Marks in the current instance are not adjusted.
- Duplicates are not removed (not that it works in Vim either now, not at
8.0.134 at least).
|
| |
|
| |
|
| |
|
|
|
|
| |
Fixes #7169
|
| |
|
| |
|
| |
|
|
|
| |
Fixes #6957
|
| |
|
| |
|
|
|
|
|
| |
shada_write was too long (over 500 lines) and caused a linting error.
Register initialization was moved to its own function in order to save lines.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Although GCC now detects possibly unintentional fall through, there
rules around which the comments are detected are rather strict. In
cases where a comment isn't detected, upstream [recommends] using their
fallthrough attribute.
[recommends]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77817#c11
|
| |
|
| |
|
|
|
|
| |
Not needed any longer since p_enc is always utf-8.
|
| |
|
| |
|
| |
|
| |
|