Commit Graph

24443 Commits

Author SHA1 Message Date
dundargoc
775e292290
build: remove nvim as a dependency of unittests (#21903)
Unittests rely on nvim-test and not nvim, leading to both nvim and
nvim-test being compiled each time a file is changed. Furthermore, the
dependencies are already specified by CMakeLists.txt and shouldn't need
to be specified in Makefile as it's only meant to be syntactic sugar.
2023-01-19 22:12:27 +01:00
Lewis Russell
5f3b76d5ce
refactor(highlight_group.c): reduce scope of locals 2023-01-19 15:54:59 +00:00
dundargoc
4c531714ff
refactor: replace char_u with char 25 (#21838)
refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2023-01-19 22:25:56 +08:00
zeertzjq
adfad50ac0
fix(rpc): don't parse msgpack if buflen is 0 (#21899)
This prevents `buflen` from becoming a very large number when it is 0
when calling mpack_rtoken().
2023-01-19 20:38:29 +08:00
dundargoc
363d153bb9
fix: pass value instead of pointer to isalpha (#21898) 2023-01-19 18:48:49 +08:00
dundargoc
00a976129b
build: enable cmake workflow presets (#21860)
Workflow presets allows combining configure, build, test and packaging
steps and makes it possible to run everything in a single command. So

cmake --preset iwyu
cmake --build --preset iwyu

instead becomes

cmake --workflow --preset iwyu

Workflow presets requires at least cmake version 3.25 to use.
2023-01-19 10:34:45 +01:00
zeertzjq
6e3890f4ce
vim-patch:8.2.4655: cmdline completion popup menu positioned wrong (#21894)
Problem:    Command line completion popup menu positioned wrong when using a
            terminal window.
Solution:   Position the popup menu differently when editing the command line.
            (Yegappan Lakshmanan, closes vim/vim#10050, closes vim/vim#10035)

1104a6d0c2

The test in the patch looks a bit hard to understand.
Add a Lua test that is more straightforward.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-19 15:13:27 +08:00
zeertzjq
93adf74a03
refactor(eval.c): factor out get_number_tv() (#21893)
It was refactored into a separate function in Vim in patch 8.2.0149.
2023-01-19 13:27:36 +08:00
zeertzjq
42e9a09a44
Merge pull request #21879 from zeertzjq/stl-click-zero-len
Fix statusline memory leaks with click labels
2023-01-19 11:00:00 +08:00
zeertzjq
01ddc09747 fix(statusline): don't leak memory with truncated click labels 2023-01-19 10:36:29 +08:00
zeertzjq
295a264b65 fix(statusline): don't leak memory with zero-width click labels
A zero-width click label isn't assigned to any click definition, so its
function name should be freed when filling click definitions.
2023-01-19 10:36:29 +08:00
zeertzjq
45dc0f3454
vim-patch:9.0.1221: code is indented more than necessary (#21891)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11833)

f97a295cca

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-19 09:51:59 +08:00
zeertzjq
f8669e8a18
vim-patch:8.2.1698: cannot lock a variable in legacy Vim script like in Vim9 (#21883)
Problem:    Cannot lock a variable in legacy Vim script like in Vim9.
Solution:   Make ":lockvar 0" work.

a187c43cfe

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-19 08:03:13 +08:00
dundargoc
42d5142367
ci: enable CI_BUILD on windows (#21557)
This will ensure warnings are treated as errors when using MSVC.

Also fix const correctness warnings. The warnings in mbyte.c are false
positives that triggers this warning on MSVC v19.32 and lower, which our
CI still use. The (void *) casts can be removed once the CI MSVC version
has been upgraded to v19.33 or higher.
2023-01-18 20:23:46 +01:00
bfredl
92a46727f7
Merge pull request #21881 from bfredl/uniterror
fix(unittests): do not consider process crash to be a success
2023-01-18 18:52:24 +01:00
bfredl
6bfbb4db1d fix(unittests): fix TUI broken test previously ignored 2023-01-18 14:56:55 +01:00
bfredl
847a1507aa fix(unittest): delete unused duplicated code
YAGNI. These were disabled 5 years ago in lint commit 29ed5b3a39
2023-01-18 14:56:55 +01:00
bfredl
9fdb586592 fix(unittests): do not consider process crash to be a success
unittests relied on the exact setup of coredumps on CI to detect
process crashing, and otherwise completely discarded errors.

Dectect child process failure reliably using process status, so that
unittests actually work locally as well.
2023-01-18 14:56:55 +01:00
dundargoc
8a4285d563
refactor: replace char_u with char 24 (#21823)
refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2023-01-18 21:17:11 +08:00
dundargoc
2c1e7242f9
refactor: replace char_u with char 23 (#21798)
Work on https://github.com/neovim/neovim/issues/459
2023-01-18 18:52:19 +08:00
Enan Ajmain
7f7b83baef
build(Windows): fix redoing version generation (#21880)
Problem: On Windows, neovim's version is generated every time nvim is
built, even if code hasn't been changed.  That is because version
generation is done based on a hash matching of a file and the content of
the file.  And in Windows they don't match, because of the DOS
line-endings.

Solution: Write the file containing nvim version with UNIX line-endings.
2023-01-18 11:48:01 +01:00
zeertzjq
36555730da
fix(statuscolumn): always fill click defs array (#21878)
Click definitions are always filled for tabline, statusline and winbar,
so they should also be always filled for statuscolumn, otherwise it will
leak memory.

Note: this doesn't actually change the existing code much, because of a
typo in the existing code.
2023-01-18 17:55:03 +08:00
zeertzjq
0aae7f3860
vim-patch:9.0.0149: test for fuzzy completion fails sometimes (#21876)
Problem:    Test for fuzzy completion fails sometimes.
Solution:   Use a more specific file name to minimize the chance of matching a
            random directory name. (closes vim/vim#10854)

5ac4b1a24e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-18 12:00:40 +08:00
Lucas Merritt
2082d275fe
refactor(PVS): suppress false positive V547 in drawline.c (#21875)
This is a false positive as "did_emsg" can be set by get_syntax_attr()

Example: get_syntax_attr() -> syn_current_attr() -> syn_getcurline()
-> ml_get_buf() -> siemsg() -> semsgv() -> emsg() -> emsg_multiline()
2023-01-18 10:36:23 +08:00
zeertzjq
0133fbb37a
vim-patch:9.0.1213: adding a line below the last one does not expand fold (#21869)
Problem:    Adding a line below the last one does not expand fold.
Solution:   Do not skip mark_adjust() when adding lines below the last one.
            (Brandon Simmons, closes vim/vim#11832, closes vim/vim#10698)

da3dd7d857

Co-authored-by: Brandon Simmons <simmsbra@gmail.com>
2023-01-18 07:33:18 +08:00
Lucas Merritt
1453c7163d
refactor(PVS/V1048): remove unnecessary assignment (#21870) 2023-01-18 07:22:25 +08:00
zeertzjq
847e603554
Merge pull request #21868 from zeertzjq/vim-9.0.1214
vim-patch:9.0.{1214,1215}
2023-01-18 07:21:57 +08:00
zeertzjq
9a2dd52a6a vim-patch:9.0.1215: using isalpha() adds dependency on current locale
Problem:    Using isalpha() adds dependency on current locale.
Solution:   Do not use isalpha() for recognizing a URL or the end of an Ex
            command. (closes vim/vim#11835)

0ef9a5c094
2023-01-18 06:50:47 +08:00
zeertzjq
8c344378b8 vim-patch:9.0.1214: file left behind after running tests
Problem:    File left behind after running tests.
Solution:   Delete the file. (Dominique Pellé, closes vim/vim#11839)

541c87c808

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2023-01-18 06:50:47 +08:00
zeertzjq
f4e03cbdbc
vim-patch:9.0.1212: cannot read back what setcellwidths() has done (#21867)
Problem:    Cannot read back what setcellwidths() has done.
Solution:   Add getcellwidths(). (Kota Kato, closes vim/vim#11837)

66bb9ae70f

Co-authored-by: Kota Kato <github@kat0h.com>
2023-01-18 06:50:22 +08:00
Lewis Russell
20b7be2d10
fix(treesitter): really restore syntax
- also unset b:ts_highlight on stop()

Fixes: #21836
2023-01-17 16:56:23 +00:00
dundargoc
0344bfad0f
refactor: replace char_u with char 22 (#21786)
Work on https://github.com/neovim/neovim/issues/459
2023-01-17 21:17:40 +08:00
zeertzjq
99186508d9
Merge pull request #21859 from zeertzjq/vim-8.2.4617
vim-patch:8.2.{4617,4618,4620,5126}
2023-01-17 20:49:08 +08:00
zeertzjq
c416da9d1a vim-patch:8.2.5126: substitute may overrun destination buffer
Problem:    Substitute may overrun destination buffer.
Solution:   Disallow switching buffers in a substitute expression.

d6211a52ab

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-17 20:26:12 +08:00
zeertzjq
8aece0089d vim-patch:8.2.4618: cmdline completion does not recognize single letter commands
Problem:    Command line completion does not recognize single letter commands.
Solution:   Use the condition from find_ex_command().

f4f0525c34

vim-patch:8.2.4620: two letter substitute commands don't work

Problem:    Two letter substitute commands don't work. (Yegappan Lakshmanan)
Solution:   Invert condition.

1e2c4175dc

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-17 20:26:12 +08:00
zeertzjq
3db2139195 vim-patch:8.2.4617: no completion for :scriptnames
Problem:    No completion for :scriptnames.
Solution:   Implement :scriptnames completion. (Yegappan Lakshmanan,
            closes vim/vim#10005)

454ce6737c

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 20:26:06 +08:00
Christian Clason
2d71ed9929
build(deps): bump tree-sitter to HEAD - eb970a83a (#21858)
includes efd22e452b which fixes some errors around infinite loops with injections
2023-01-17 12:57:06 +01:00
zeertzjq
132f001ce8
vim-patch:8.2.4483: command completion makes two rounds to collect matches (#21857)
Problem:    Command completion makes two rounds to collect matches.
Solution:   Use a growarray to collect matches. (Yegappan Lakshmanan,
            closes vim/vim#9860)

5de4c4372d

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 19:52:02 +08:00
zeertzjq
ddd69a6c81
vim-patch:8.2.4959: using NULL regexp program (#21855)
Problem:    Using NULL regexp program.
Solution:   Check for regexp program becoming NULL in more places.

b62dc5e782

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-17 17:02:25 +08:00
zeertzjq
b4d669e7ac
vim-patch:8.2.4928: various white space and cosmetic mistakes (#21854)
Problem:    Various white space and cosmetic mistakes.
Solution:   Change spaces to tabs, improve comments.

6ed545e797

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-17 16:53:37 +08:00
zeertzjq
58f2dcfc88
vim-patch:8.2.4917: fuzzy expansion of option names is not right (#21853)
Problem:    Fuzzy expansion of option names is not right.
Solution:   Pass the fuzzy flag down the call chain. (Christian Brabandt,
            closes vim/vim#10380, closes vim/vim#10318)

cb747899bd

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-01-17 16:46:43 +08:00
zeertzjq
8abf53be6e
vim-patch:9.0.0089: fuzzy argument completion doesn't work for shell commands (#21852)
Problem:    Fuzzy argument completion doesn't work for shell commands.
Solution:   Check for cmdidx not being CMD_bang. (Yegappan Lakshmanan,
            closes vim/vim#10769)

7db3a8e329

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 16:28:15 +08:00
zeertzjq
fc692dfce1
Merge pull request #21851 from zeertzjq/vim-8.2.4482
vim-patch:8.2.{4482,4485}: fuzzy cmdline custom completion
2023-01-17 16:16:44 +08:00
zeertzjq
d512678739 fix(completion): correct what modes support fuzzy completion 2023-01-17 15:55:58 +08:00
zeertzjq
441d13eae5 vim-patch:8.2.4482: no fuzzy cmdline completion for user defined completion
Problem:    No fuzzy cmdline completion for user defined completion.
Solution:   Add fuzzy completion for user defined completion. (Yegappan
            Lakshmanan, closes vim/vim#9858)

afd4ae35d6

Cherry-pick related docs from Vim runtime.

N/A patches for version.c:

vim-patch:8.2.4485: compiler warning for uninitialized variable
vim-patch:8.2.4732: duplicate code to free fuzzy matches

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 15:55:58 +08:00
zeertzjq
2093e574c6
Merge pull request #21850 from zeertzjq/vim-8.2.4463
vim-patch:8.2.{4463,4465,4475,4477,4478,4479,4608}: fuzzy cmdline builtin completion
2023-01-17 14:34:27 +08:00
zeertzjq
15e42dd449 vim-patch:8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Problem:    getcompletion() does not work properly when 'wildoptions
            contains "fuzzy".
Solution:   Do not use addstar(). (Yegappan Lakshmanan, closes vim/vim#9992,
            closes vim/vim#9986)

e7dd0fa2c6

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 14:01:26 +08:00
zeertzjq
5ce6685119 vim-patch:8.2.4479: no fuzzy completieon for maps and abbreviations
Problem:    No fuzzy completieon for maps and abbreviations.
Solution:   Fuzzy complete maps and abbreviations. (Yegappan Lakshmanan,
            closes vim/vim#9856)

6caeda2fce

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 14:01:26 +08:00
zeertzjq
245522db1e vim-patch:8.2.4478: crash when using fuzzy completion
Problem:    Crash when using fuzzy completion.
Solution:   Temporary fix: put back regexp. (closes vim/vim#9852, closes vim/vim#9851)

00333cb3b3

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 14:01:26 +08:00
zeertzjq
bdd14d03c7 vim-patch:8.2.4477: crash when using fuzzy completion
Problem:    Crash when using fuzzy completion.
Solution:   Temporary fix: put back regexp. (closes vim/vim#9851)

29ab6ce9f3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-17 14:01:26 +08:00