mirror of
https://github.com/neovim/neovim.git
synced 2025-09-25 20:48:32 +00:00
ga_growsize should be >= 1
I know it could be 0 sometimes. Running the tests with `assert(gap->ga_growsize > 0)` in ga_grow() crashes nvim while running the tests. - Add a setter for ga_growsize that checks whether the value passed is >=1 (log in case it's not) - log when ga_grow() tries to use a ga_growsize that's not >=1 - use GA_EMPTY_INIT_VALUE is many places
This commit is contained in:

committed by
Justin M. Keyes

parent
d723e7fd61
commit
be3a4b6ca8
@@ -2790,7 +2790,7 @@ char_u *getsourceline(int c, void *cookie, int indent)
|
||||
/* Adjust the growsize to the current length to speed up
|
||||
* concatenating many lines. */
|
||||
if (ga.ga_len > 400) {
|
||||
ga.ga_growsize = (ga.ga_len > 8000) ? 8000 : ga.ga_len;
|
||||
ga_set_growsize(&ga, (ga.ga_len > 8000) ? 8000 : ga.ga_len);
|
||||
}
|
||||
ga_concat(&ga, p + 1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user