Commit Graph

21651 Commits

Author SHA1 Message Date
Jonas Strittmatter
52623ce935
refactor(runtime): convert the remaining dist#ft functions to lua (#18623) 2022-05-22 12:16:04 -06:00
dundargoc
8c2fd65bb1
build(clint): remove redundant checks #18698
Uncrustify is the source of truth where possible.
Remove any redundant checks from clint.py.
See also https://github.com/neovim/neovim/pull/18563
2022-05-22 10:59:56 -07:00
bfredl
5250d5c1b1
Merge pull request #18646 from bfredl/winbarruler
fix(winbar): allow winbar to display a ruler
2022-05-22 19:43:30 +02:00
James McCoy
47d9a393de
fix(cid/352839): USE_AFTER_FREE in create_user_command #18669 2022-05-22 10:29:15 -07:00
bfredl
7f6d2984a8
Merge pull request #18608 from ckipp01/extmarkDocs
docs(extmark): remove message about passing in id=0
2022-05-22 19:07:51 +02:00
bfredl
060ef52d8b fix(winbar): allow winbar to display the ruler 2022-05-22 18:56:07 +02:00
Daniel Steinberg
3fe6bf3a1e
fix(mksession): don't store floats in session #18635
Problem:
If there are floating windows when `:mksession` runs, the session cannot
be properly restored.

Solution:
Change `:mksession` to skip floating windows. This matches Vim's
treatment of popup windows.

An alternative approach could have `:mksession` save floating windows
that can be _properly_ restored (rather than skip them entirely, which
is what this PR does). While that would seemingly be a more complete
fix, that could present additional issues since floating windows are
ordinarily created by plugins, and they may no longer be properly under
a plugin's control when restored.

closes #18432
2022-05-22 09:03:56 -07:00
bfredl
b863c150c9
Merge pull request #18696 from bfredl/quickinc
fix(tests): fix some issues with ui/inccommand_spec.lua causing slowness
2022-05-22 17:51:31 +02:00
dundargoc
63741176ce
ci(commitlint): only trigger on PRs to master #18679
This will prevent a failure for backported PRs as they use a different
commit message.
2022-05-22 08:03:06 -07:00
bfredl
9b34723bcc
Merge pull request #18693 from bfredl/quicklsp
fix(ci): remove 2000ms blocking wait in many plugin/lsp_spec.lua tests
2022-05-22 16:25:17 +02:00
bfredl
e01c197eab fix(tests): fix some issues with ui/inccommand_spec.lua causing slowness
from ~30 to ~20 secs with ASAN build

- feedkeys test: the same substitute was repeated, and not even correctly spelled
- don't clear() in a tight loop. "bwipe!" is enough to erase undo history
- error in cnoremap mapping causes a check_for_delay(). <c-c> it away.
2022-05-22 16:17:37 +02:00
zeertzjq
566ee48f05
vim-patch:8.2.4935: with 'foldmethod' "indent" some lines not included in fold (#18694)
Problem:    With 'foldmethod' "indent" some lines are not included in the
            fold. (Oleg Koshovetc)
Solution:   Fix it. (Brandon Simmons, closes vim/vim#10399, closes vim/vim#3214)
d98e75e236
2022-05-22 21:37:25 +08:00
zeertzjq
70e3caec4a
fix(folds): fix fold regression with :move (#18685) 2022-05-22 21:03:22 +08:00
bfredl
e7b3fd8ad6
Merge pull request #18681 from bfredl/uitest
fix(tests): fix some screen.lua warnings
2022-05-22 14:32:38 +02:00
bfredl
58b9b7e7c4 fix(ci): remove 2000ms blocking wait in many plugin/lsp_spec.lua tests
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.
2022-05-22 14:14:58 +02:00
dundargoc
2cab6bea09
docs: remove "Vi default" #18672
It's not relevant and clutters the documentation.
2022-05-22 04:38:59 -07:00
zeertzjq
5193b17839
vim-patch:8.2.4993: smart/C/lisp indenting is optional (#18684)
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
2022-05-22 07:52:11 +08:00
Brandon Simmons
0c4086faa1
vim-patch:8.2.4987: after deletion a small fold may be closable (#18683)
Problem:    After deletion a small fold may be closable.
Solution:   Check for a reverse range. (Brandon Simmons, closes vim/vim#10457)
3fcccf94e8
2022-05-22 07:27:54 +08:00
zeertzjq
f0717ffade
Merge pull request #18682 from zeertzjq/vim-8.1.0535
vim-patch:8.1.0535,8.2.4991: increment/decrement might get interrupted by updating folds
2022-05-22 07:27:26 +08:00
zeertzjq
c3568b31f4 vim-patch:8.2.4991: no test for hwat patch 8.1.0535 fixes
Problem:    No test for hwat patch 8.1.0535 fixes.
Solution:   Add a test. (closes vim/vim#10462)
93c1573dd2
2022-05-22 06:41:31 +08:00
zeertzjq
a1df7c5771 vim-patch:8.1.0535: increment/decrement might get interrupted by updating folds
Problem:    Increment/decrement might get interrupted by updating folds.
Solution:   Disable fold updating for a moment. (Christian Brabandt,
            closes vim/vim#3599)
6b731886ca
2022-05-22 06:41:31 +08:00
bfredl
cbf0360179
Merge pull request #13729 from devbhansingh/ui_enter_prompt
feat(ui): clear message history explicitly with msg_history_clear event
2022-05-21 23:59:14 +02:00
devbhan singh
646e1c3a3a feat(ui): clear message history explicitly with msg_history_clear event 2022-05-21 23:22:23 +02:00
bfredl
3c1bc75447 fix(tests): fix some screen.lua warnings 2022-05-21 23:07:34 +02:00
dundargoc
1f1a65a9e4
ci: fix lint errors caused by missing includes (#18673)
This will fix the `check-single-includes` check which started failing
after https://github.com/neovim/neovim/pull/18663/.
2022-05-21 17:27:54 +02:00
kylo252
55246d44f9
fix(autocmds): separate command from desc (#18617) 2022-05-21 15:55:48 +02:00
dundargoc
976f32aa7a
refactor: add warnings for deprecated functions (#18662) 2022-05-21 09:51:03 +02:00
dundargoc
12f45fd697
ci: bump github actions versions #18616 2022-05-20 20:45:10 -07:00
dundargoc
79469e61d5
build(clint.py): remove rules for includes, whitespace, tabs #18611
Uncrustify is the source of truth where possible.
Remove any redundant checks from clint.py.
See also https://github.com/neovim/neovim/pull/18563

Closes https://github.com/neovim/neovim/issues/17763
2022-05-20 20:43:30 -07:00
dundargoc
045aacc384
ci: lint with uncrustify #18563
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).
2022-05-20 20:41:57 -07:00
Lewis Russell
4c97e17d38
refactor: remove unused USE_WCHAR_FUNCTIONS #18618
USE_WCHAR_FUNCTIONS is never defined and we don't trust libc wchar
functions anyway.
2022-05-20 20:31:32 -07:00
Jun-ichi TAKIMOTO
afa99f42b3
fix(unittests): coredump when running unit tests #18663
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.
2022-05-20 20:18:17 -07:00
James McCoy
b3453ea4a6
Merge pull request #18648 from jamessan/coverity-fixes 2022-05-20 14:22:15 -04:00
bfredl
c847a0eeb7
Merge pull request #18664 from famiu/fix/winbar_crash
fix: prevent crash when statusline expression sets value of 'winbar'
2022-05-20 19:29:34 +02:00
Christian Clason
cda0ef23cf
build(deps): bump LuaJIT to HEAD - 4ef96cff8 (#18656) 2022-05-20 19:19:37 +02:00
Famiu Haque
e884e460bc fix: prevent crash when statusline expression sets value of 'winbar'
Closes #18649
2022-05-20 23:03:06 +06:00
bfredl
ffb55261a8
Merge pull request #18653 from dundargoc/refactor/move-reverse-text
refactor: move reverse_text to strings.c as it's a string operation
2022-05-20 17:00:51 +02:00
zeertzjq
76691bea04
Merge pull request #18657 from dundargoc/vim-8.2.4985
vim-patch:8.2.4985: PVS warns for possible array underrun
2022-05-20 22:23:20 +08:00
Dundar Goc
1a0de90068 refactor: move reverse_text to strings.c as it's a string operation
Also add tests for reverse_text.

Co-authored-by: Kalle Ranki <kalle.ranki@gmail.com>
2022-05-20 16:11:54 +02:00
Dundar Goc
02fd4ec83f vim-patch:8.2.4985: PVS warns for possible array underrun
Problem:    PVS warns for possible array underrun.
Solution:   Add a check for a positive value. (closes vim/vim#10451)
875339b22a
2022-05-20 15:15:13 +02:00
bfredl
1d160a76ec
Merge pull request #18641 from famiu/fix/nvim_cmd/keymap_error_suppress
fix: make `nvim_cmd` not suppress errors inside key mapping
2022-05-20 14:22:44 +02:00
James McCoy
3e627f9e55
ci(coverity): run every day instead of once/week
Neovim currently falls in the 100 kLOC - 500 kLOC bucket, which can scan
3x/day.
2022-05-20 08:17:47 -04:00
James McCoy
83f42e086a
perf(cid/350479): avoid copying ExtmarkInfo when calling extmark_to_array() 2022-05-20 08:17:39 -04:00
James McCoy
501ee06d3a
fix(cid/352782): assert str->items is non-NULL to hint static analyzers
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.
2022-05-20 08:17:33 -04:00
James McCoy
d31e68d5d0
fix(cid/348314): free user_copy, not user
user is passed in by the caller, which we internally copy.  We should be
freeing our copy, not the caller's string.
2022-05-20 08:15:13 -04:00
James McCoy
f15122e8a2
fix(cid/351940): free compl_arg in create_user_commands()'s error path exit 2022-05-20 08:15:07 -04:00
James McCoy
6954c0ba0d
ci(coverity): annotate register_cfunc as leaking memory
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.
2022-05-20 08:14:37 -04:00
James McCoy
1da7e2b8ca
ci(coverity): model our allocation functions
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.
2022-05-20 08:14:20 -04:00
Fredrik Ekre
a4862cbb5f
fix(lsp): only send diagnostics from current buffer in code_action() (#18639)
Fix vim.lsp.buf.(range_)code_action() to only send diagnostics belonging
to the current buffer and not to other files in the workspace.
2022-05-20 13:11:23 +02:00
zeertzjq
eb0aa8bb0e
vim-patch:8.2.4980: when 'shortmess' contains 'A' loading session may still warn (#18636)
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.
            (closes vim/vim#10443)
aaadb5b6f7

Use readfile() with "B" flag in test as readblob() needs patch 8.2.2343.
2022-05-20 07:20:38 +08:00