Cuts down typical run time for `plugin/lsp_spec.lua`
from 70 secs to 12 secs in ASAN CI build.
This happens in ASAN/EXIT_FREE builds where nvim waits 2000ms due to
unclosed handled. I wasn't able to pin-point the exact cause.
But these tests ran in nested context where two server/client pairs
were setup for no good reason. Moving these tests out so only one client
is being setup fixed the exit hang.
Problem: smart/C/lisp indenting is optional, which makes the code more
complex, while it only reduces the executable size a bit.
Solution: Graduate FEAT_CINDENT, FEAT_SMARTINDENT and FEAT_LISP.
8e145b8246
Problem: Increment/decrement might get interrupted by updating folds.
Solution: Disable fold updating for a moment. (Christian Brabandt,
closesvim/vim#3599)
6b731886ca
This lint job will ensure that the C codebase is properly formatted at
all times. This helps eliminate most of clint.py.
To save CI time, it's faster to manually compile uncrustify and cache
the binary instead of using homebrew (the apt-get package is too old).
fs_init() must be called before early_init() in init/helpers.lua
If I run 'make unittest' on my Mac (macOS 10.14/Mojave or 12/Big Sur, intel
CPU), every test produce a core dump.
Call sequence in the core is:
early_init() main.c:197
set_init_1() option.c:508
runtimepath_default() runtime.c:1205
get_lib_dir() runtime.c:1175
os_isdir() fs.c:137
os_getperm() fs.c:777
os_stat() fs.c:761
fs_loop_lock() fs.c:72
uv_mutex_lock(&fs_loop_mutex) thread.c:352
abort()
.deps/build/src/libuv/src/unix/thread.c:
void uv_mutex_lock(uv_mutex_t* mutex) {
if (pthread_mutex_lock(mutex))
abort(); // line 352
}
So pthread_mutex_lock(&fs_loop_mutex) failed. The reason seems to be simple.
fs_init() was not called and fs_loop_mutex has not been initialized. fs_init()
was moved out from early_init() in main.c by
b87867e69e, but unit/helpers.lua was not updated
accordingly.
The earlier vsnprintf() call checks whether str->items is NULL, sets of
the "possible NULL" spidey sense. kv_ensure_space() guarantees
str->items is non-NULL but since it doesn't use NULL checks to decide
whether to alloc, static analyzers can't tell this code path is safe.
register_cfunc allocates a ufunc_T, but doesn't store the pointer
anywhere before returning. The uf_name member variable is stored in a
hashtable and used to lookup the ufunc_T later, but that's too much for
Coverity to track.
Adding the annotation ensures that any new callers to register_cfunc
don't pop up as new "leaks" in the Coverity scans.
Coverity was reporting false positives, particularly around for non-NUL
terminated strings around uses of xmemdupz(). The updated model
ensures Coverity understands xmemdupz allocates an extra byte and sets it
to NUL as well as the main details of our other allocation related
wrappers.
Problem: When 'shortmess' contains 'A' loading a session may still warn for
an existing swap file. (Melker Österberg)
Solution: Keep the 'A' flag to 'shortmess' in the session file.
(closesvim/vim#10443)
aaadb5b6f7
Use readfile() with "B" flag in test as readblob() needs patch 8.2.2343.
The docs for `nvim_buf_set_extmark` mention that you can create a new
extmark when passing in `id=0`, however if you do this you'll get an
error since the code checks that id is positive.
```
id is not a positive integer
```
This change re-words the sentence to make it clearer.