| Commit message (Collapse) | Author | Age |
... | |
| |\ \
| | | |
| | | | |
fix(marktree): preserve ordering in `marktree_move`
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`marktree_move` is making the tree out of order at:
https://github.com/neovim/neovim/blob/be10d65bfafe056025ffffa2c1131712b9a493a5/src/nvim/marktree.c#L1188
Because `key` is at the new position, and `x->key[new_i]` is also at the
new position, this comparison spuriously returns true, which causes
`x->key[i]` to be updated in-place even when it needs to be moved.
This causes crashes down the line, since the ordering of `MTNode.key` is
an invariant that must be preserved.
Fixes: #25157
|
| |/ / |
|
| |\ \
| | | |
| | | | |
fix(marktree): off-by-one error in `marktree_move`
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
If you would insert element X at position j, then if you are moving that
same element X from position i < j, you should move it to position j -
1, because you are losing an element.
This error caused a gap to be left in the array, so that it looked like
[x, null, y] instead of [x, y], where len = 2. This triggered #25147.
Fixes: #25147
|
| |\ \ \
| | |/ /
| |/| | |
fix(float): don't trigger au event when enter is false
|
| | | | |
|
| | | |
| | | |
| | | | |
Also make virt_text_hide work properly.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
When tabstop and shiftwidth are not equal, tabs are inserted as individual
spaces and then rewritten as tab characters in a second pass. That second pass
did not call changed_bytes which resulted in events being omitted.
Fixes #25092
|
| | | |
| | | |
| | | | |
fix(extmarks): draw virt_text properly below diff filler lines
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
TODO: virt_text_hide doesn't work for the first char on a wrapped screen
line, and it's not clear how to fix that.
|
| | | | |
|
| | |/
| |/| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Co-authored-by: nuid64 <lvkuzvesov@proton.me>
Co-authored-by: Mike Smith <10135646+mikesmithgh@users.noreply.github.com>
Co-authored-by: XTY <xty@xty.io>
Co-authored-by: Empa <emanuel@empa.xyz>
Co-authored-by: kyu08 <49891479+kyu08@users.noreply.github.com>
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
An insert-only set now defines a monotonically increasing ordering by
itself. It can be used to both lookup the key from index, and vice versa.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The removes the previous restriction that nvim_buf_set_extmark()
could not be used to highlight arbitrary multi-line regions
The problem can be summarized as follows: let's assume an extmark with a
hl_group is placed covering the region (5,0) to (50,0) Now, consider
what happens if nvim needs to redraw a window covering the lines 20-30.
It needs to be able to ask the marktree what extmarks cover this region,
even if they don't begin or end here.
Therefore the marktree needs to be augmented with the information covers
a point, not just what marks begin or end there. To do this, we augment
each node with a field "intersect" which is a set the ids of the
marks which overlap this node, but only if it is not part of the set of
any parent. This ensures the number of nodes that need to be explicitly
marked grows only logarithmically with the total number of explicitly
nodes (and thus the number of of overlapping marks).
Thus we can quickly iterate all marks which overlaps any query position
by looking up what leaf node contains that position. Then we only need
to consider all "start" marks within that leaf node, and the "intersect"
set of that node and all its parents.
Now, and the major source of complexity is that the tree restructuring
operations (to ensure that each node has T-1 <= size <= 2*T-1) also need
to update these sets. If a full inner node is split in two, one of the
new parents might start to completely overlap some ranges and its ids
will need to be moved from its children's sets to its own set.
Similarly, if two undersized nodes gets joined into one, it might no
longer completely overlap some ranges, and now the children which do
needs to have the have the ids in its set instead. And then there are
the pivots! Yes the pivot operations when a child gets moved from one
parent to another.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Problem:
* The guessed botline might be smaller than the actual botline e.g. when
there are folds and the user is typing in insert mode. This may result
in incorrect treesitter highlights for injections.
* botline can be larger than the last line number of the buffer, which
results in errors when placing extmarks.
Solution:
* Take a more conservative approximation. I am not sure if it is
sufficient to guarantee correctness, but it seems to be good enough
for the case mentioned above.
* Clamp it to the last line number.
Co-authored-by: Lewis Russell <me@lewisr.dev>
|
| | | |
|
| |\ \
| | | |
| | | | |
refactor(memline): cleanup typedefs for memline structs
|
| | | |
| | | |
| | | |
| | | |
| | | | |
These were used interchangedly by the struct name and the typedef name.
Use standard pattern type names and use these consistently
|
| | | |
| | | |
| | | |
| | | | |
Fixes #22526
|
| |/ / |
|
| | |
| | |
| | |
| | | |
Also remove some stray comments.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Memfile used a private implementation of an open hash table with intrusive collision chains, but there is
no reason to assume the standard khash_t based Map won't work just fine.
Yes, we are taking full ownership and maintenance over memline and memfile.
No one is going to maintain it for us.
Trust the plan.
|
| | | |
|
| | | |
|
| |\ \
| | | |
| | | | |
fix(highlight): add create param in nvim_get_hl api function
|
| | |/ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Problem: Various Typos
Solution: Fix Typos
This is a collection of typo related commits.
closes: vim/vim#12753
closes: vim/vim#13016
https://github.com/vim/vim/commit/ee17b6f70d382ec6c5d8d27b56c4e84106ac8c55
Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Adri Verhoef <a3@a3.xs4all.nl>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Co-authored-by: nuid64 <lvkuzvesov@proton.me>
Co-authored-by: Meng Xiangzhuo <aumo@foxmail.com>
Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: missing test for patch 9.0.1873
Solution: add a test trying to exchange windows
Add a test, making sure that switching windows is not allowed when
textlock is active, e.g. when running `:s/<pat>/\=func()/`
https://github.com/vim/vim/commit/18d2709aa12ffa3f6ae1a13059990558c5f8e406
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Wrong order of arguments for error messages
Solution: Reverse order or arguments for e_aptypes_is_null_nr_str
closes: vim/vim#13051
https://github.com/vim/vim/commit/1bd2cb11694690a77e4141bce2e34d9dfb882f1c
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This involves two redesigns of the map.c implementations:
1. Change of macro style and code organization
The old khash.h and map.c implementation used huge #define blocks with a
lot of backslash line continuations.
This instead uses the "implementation file" .c.h pattern. Such a file is
meant to be included multiple times, with different macros set prior to
inclusion as parameters. we already use this pattern e.g. for
eval/typval_encode.c.h to implement different typval encoders reusing a
similar structure.
We can structure this code into two parts. one that only depends on key
type and is enough to implement sets, and one which depends on both key
and value to implement maps (as a wrapper around sets, with an added
value[] array)
2. Separate the main hash buckets from the key / value arrays
Change the hack buckets to only contain an index into separate key /
value arrays
This is a common pattern in modern, state of the art hashmap
implementations. Even though this leads to one more allocated array, it
is this often is a net reduction of memory consumption. Consider
key+value consuming at least 12 bytes per pair. On average, we will have
twice as many buckets per item.
Thus old implementation:
2*12 = 24 bytes per item
New implementation
1*12 + 2*4 = 20 bytes per item
And the difference gets bigger with larger items.
One might think we have pulled a fast one here, as wouldn't the average size of
the new key/value arrays be 1.5 slots per items due to amortized grows?
But remember, these arrays are fully dense, and thus the accessed memory,
measured in _cache lines_, the unit which actually matters, will be the
fully used memory but just rounded up to the nearest cache line
boundary.
This has some other interesting properties, such as an insert-only
set/map will be fully ordered by insert only. Preserving this ordering
in face of deletions is more tricky tho. As we currently don't use
ordered maps, the "delete" operation maintains compactness of the item
arrays in the simplest way by breaking the ordering. It would be
possible to implement an order-preserving delete although at some cost,
like allowing the items array to become non-dense until the next rehash.
Finally, in face of these two major changes, all code used in khash.h
has been integrated into map.c and friends. Given the heavy edits it
makes no sense to "layer" the code into a vendored and a wrapper part.
Rather, the layered cake follows the specialization depth: code shared
for all maps, code specialized to a key type (and its equivalence
relation), and finally code specialized to value+key type.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
vim-patch:9.0.1866: undo is synced after character find
Problem: Undo is synced after character find.
Solution: Set no_u_sync when calling gotchars_nop().
closes: vim/vim#13022
closes: vim/vim#13024
https://github.com/vim/vim/commit/dccc29c228f8336ef7dd069a447886639af4458e
|
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: wrong format specifiers in e_aptypes_is_null_str_nr
Solution: Fix the wrong format specifier
closes: vim/vim#13020
https://github.com/vim/vim/commit/7db89bdc23e53c7bc43af6f1c7281bc69a6a3098
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: issues with formatting positional arguments
Solution: fix them, add tests and documentation
closes: vim/vim#12140
closes: vim/vim#12985
Tentatively fix message_test. Check NULL ptr.
https://github.com/vim/vim/commit/aa90d4f031f73a34aaef5746931ea746849a2231
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- simplify lua interpreter search
- fix incorrect variable name in BuildLua.cmake
- build PUC Lua with -O2
- silence non-mandatory find_package search for libuv
- simplify Find modules
- Prefer using the explicitly set CI_BUILD over relying on the
environment variable "CI".
|
| |\
| | |
| | | |
fix(memline): more curbuf stuff
|
| | | |
|
| | |
| | |
| | |
| | | |
The two calls to get_view_file() both pass a char in a string, and
get_view_file() assigns it to a char in a string.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Problem: buffer-overflow in vim_regsub_both()
Solution: Check remaining space
https://github.com/vim/vim/commit/ced2c7394aafdc90fb7845e09b3a3fee23d48cb1
The change to do_sub() looks confusing. Maybe it's an overflow check?
Then the crash may not be applicable to Nvim because of different casts.
The test also looks confusing. It seems to source itself recursively.
Also don't call strlen() twice on evaluation result.
N/A patches for version.c:
vim-patch:9.0.1849: CI error on different signedness in ex_cmds.c
vim-patch:9.0.1853: CI error on different signedness in regexp.c
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Problem: use-after-free in do_ecmd
Solution: Verify oldwin pointer after reset_VIsual()
https://github.com/vim/vim/commit/e1dc9a627536304bc4f738c21e909ad9fcf3974c
N/A patches for version.c:
vim-patch:9.0.1841: style: trailing whitespace in ex_cmds.c
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
| | |
| | |
| | | |
refactor(mark): don't set same timestamp twice
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Problem: potential oob write in do_addsub()
Solution: don't overflow buf2, check size in for loop()
https://github.com/vim/vim/commit/889f6af37164775192e33b233a90e86fd3df0f57
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Problem: crash in fullcommand
Solution: Check for typeval correctly
https://github.com/vim/vim/commit/4c6fe2e2ea62469642ed1d80b16d39e616b25cf5
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Problem: i_CTRL-O does not reset Select Mode
Solution: Reset select mode on CTRL-O in insert mode
closes: vim/vim#13001
closes: vim/vim#12115
https://github.com/vim/vim/commit/d69aecf141ff05a645d02f39f1cbf6381ed7d0c0
Co-authored-by: pierreganty <pierreganty@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
|