Commit Graph

22779 Commits

Author SHA1 Message Date
zeertzjq
207fe4810e vim-patch:9.0.0270: some values of 'path' and 'tags' invalid in the tiny version
Problem:    Some values of 'path' and 'tags' do not work in the tiny version.
Solution:   Graduate the +path_extra feature.
2bd9dbc19f
2022-08-26 07:00:52 +08:00
zeertzjq
4dd34989cd vim-patch:9.0.0263: too many #ifdefs
Problem:    Too many #ifdefs.
Solution:   Make some functions always available.
6d4b2f54df

N/A patches for version.c:

vim-patch:9.0.0262: build failure without the +quickfix feature

Problem:    Build failure without the +quickfix feature.
Solution:   Add #ifdef.
2e6dcbc445

vim-patch:9.0.0266: compiler warning for unused argument

Problem:    Compiler warning for unused argument.
Solution:   Add UNUSED.
340dafd155

vim-patch:9.0.0268: build error without the +eval feature

Problem:    Build error without the +eval feature.
Solution:   Remove #ifdef.
0166e398d1
2022-08-26 07:00:50 +08:00
bfredl
6e9980fc3b
Merge pull request #19628 from dundargoc/refactor/char_u/2
refactor: replace char_u with char
2022-08-25 22:35:20 +02:00
bfredl
bfd1adc62c
Merge pull request #19946 from bfredl/newnode
feat: upstream some nvim-treesitter functions
2022-08-25 21:35:13 +02:00
bfredl
73ee2b35d1 fix(tests): use pending_c_parser when needed 2022-08-25 20:49:27 +02:00
Dundar Goc
40855b0143 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-25 18:59:12 +02:00
bfredl
e5fe41198c fix(treesitter): more efficient node:root() 2022-08-25 18:24:56 +02:00
bfredl
8554164b1e fix(docs): update auto-generated documentation 2022-08-25 18:01:27 +02:00
Quentin Rasmont
244a115e49 feat(treesitter): clarify similar 'get_node_range' functions
The private 'get_node_range' function from the languagetree module has
been renamed and remains private as it serve a purpose that is only
relevant inside the languagetree module.

The 'get_node_range' upstreamed from nvim-treesitter in the treesitter
module has been made public as it is in itself a utlity function.
2022-08-25 18:01:15 +02:00
Quentin Rasmont
133ff6e11e feat(treesitter): upstream node_contains()
Util from the nvim-treesitter project.
2022-08-25 18:01:15 +02:00
Quentin Rasmont
f57341a4b6 feat(treesitter): upstream node_length() as a node method
Util from the nvim-treesitter project.
2022-08-25 18:01:14 +02:00
Quentin Rasmont
baba43681e feat(treesitter): upstream get_root_for_node() as a node method
Util from the nvim-treesitter project.
2022-08-25 18:01:14 +02:00
Quentin Rasmont
a577fb778a feat(treesitter): upstream get_named_children() as a node method
Util from the nvim-treesitter project.
2022-08-25 18:01:14 +02:00
Quentin Rasmont
6b2d42eb03 feat(treesitter): add ability to retreive a tree/node given a range 2022-08-25 18:01:14 +02:00
Quentin Rasmont
733b2e12b8 feat(treesitter): add opts.concat to query.get_text_node
As part of the upstream of utility functions from nvim-treesitter, this
option when set to false allows to return a table (downstream behavior).
Effectively making the switch from the downstream to the upstream
function much easier.
2022-08-25 18:01:14 +02:00
Quentin Rasmont
3aba4ba378 feat(treesitter): upstream is_parent()
Util from the nvim-treesitter project.
Renamed is_parent to is_ancestor for clarity.
2022-08-25 18:01:14 +02:00
zeertzjq
22f9200302
Merge pull request #19945 from zeertzjq/vim-8.2.0911
vim-patch:8.2.{0911,0923}: cmdwin interrupted
2022-08-25 22:02:29 +08:00
zeertzjq
22536eb527 vim-patch:8.2.0923: cmdline test is slow
Problem:    Cmdline test is slow.
Solution:   Use WaitForAssert().
c82dd86084
2022-08-25 21:38:11 +08:00
zeertzjq
4ecea0e001 vim-patch:8.2.0911: crash when opening a buffer for the cmdline window fails
Problem:    Crash when opening a buffer for the cmdline window fails. (Chris
            Barber)
Solution:   Check do_ecmd() succeeds.  Reset got_int if "q" was used at the
            more prompt. (closes vim/vim#6211)
9b7cce28d5

Make code match latest Vim instead.
2022-08-25 21:38:11 +08:00
Lewis Russell
99f8d34c8a
Merge pull request #19934 from lewis6991/prepostincr 2022-08-25 14:30:12 +01:00
zeertzjq
cd2d3aa48f
vim-patch:9.0.0261: bufload() reads a file even if the name is not a file name (#19944)
Problem:    bufload() reads a file even if the name is not a file name. (Cyker
            Way)
Solution:   Do not read the file when the buffer name is not a file name.
            (closes vim/vim#10975)
2eddbacd6d
2022-08-25 20:23:29 +08:00
Lewis Russell
93f24403f8 refactor: pre-incr to post-incr 2022-08-25 13:10:41 +01:00
zeertzjq
1b29288709
vim-patch:8.2.4356: command line completion functions are very long (#19943)
Problem:    Command line completion functions are very long.
Solution:   Refactor into multiple functions. (Yegappan Lakshmanan,
            closes vim/vim#9753)
620d8edba0

Change fifth argument of set_context_by_cmdname() to "context".
2022-08-25 19:06:26 +08:00
zeertzjq
274e1122ad
fix(usercmd): also check for whitespace after escaped character (#19942) 2022-08-25 17:57:32 +08:00
zeertzjq
f0658fd552
refactor: suppress clang and PVS warnings (#19940) 2022-08-25 15:20:54 +08:00
Christian Clason
5c9baa6f35
docs(contributing): add documenting guidelines from wiki (#19924)
Co-authored-by: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
2022-08-25 09:06:37 +02:00
zeertzjq
170617c7a2
Merge pull request #19939 from zeertzjq/vim-8.2.4289
vim-patch: compiler warnings
2022-08-25 13:41:17 +08:00
zeertzjq
6584f3a2b6 vim-patch:8.2.4289: warnings reported by MSVC
Problem:    Warnings reported by MSVC.
Solution:   Rename variables and other fixes. (Ken Takata, closes vim/vim#9689)
5411910c77

N/A patches for version.c:

vim-patch:8.2.0091: compiler warnings for size_t / int types

Problem:    Compiler warnings for size_t / int types.
Solution:   Change type to size_t. (Mike Williams)
4d7a248b64

vim-patch:8.2.1299: compiler warning for using size_t for int and void pointer

Problem:    Compiler warning for using size_t for int and void pointer.
Solution:   Add type casts.
d3bb6a82a5

vim-patch:8.2.1906: warning for signed/unsigned

Problem:    Warning for signed/unsigned.
Solution:   Use size_t instead of int. (Mike Williams)
a360dbe3b6

vim-patch:8.2.4531: LGTM warnings for condition and buffer size

Problem:    LGTM warnings for condition always true and buffer size too small.
Solution:   Remove the useless condition.  Make the buffer larger. (Goc
            Dundar, closes vim/vim#9914)
f01a653ac5

vim-patch:8.2.4624: old Coverity warning for resource leak

Problem:    Old Coverity warning for resource leak.
Solution:   Close the file if memory allocation fails.
5d46dcfeed

vim-patch:9.0.0129: compiler warning for int/size_t usage

Problem:    Compiler warning for int/size_t usage.
Solution:   Add a type cast. (Mike Williams, closes vim/vim#10830)
ab146dac6b
2022-08-25 13:18:49 +08:00
zeertzjq
e7dd65eea3 vim-patch:8.2.2826: compiler warnings for int to size_t conversion
Problem:    Compiler warnings for int to size_t conversion. (Randall W.
            Morris)
Solution:   Add type casts.
551c1aed65

Still keep it size_t, but avoid calculating multiple times.
2022-08-25 13:06:33 +08:00
zeertzjq
7656cd527b vim-patch:8.2.1960: warning for uninitialized variable
Problem:    Warning for uninitialized variable.
Solution:   Initialize the variable.
0fd797eacd
2022-08-25 13:02:01 +08:00
zeertzjq
88738bd28f vim-patch:8.2.1728: compiler warning for using uninitialized variable
Problem:    Compiler warning for using uninitialized variable. (John Marriott)
Solution:   Initialize "neighbor".
c53e9c57a9
2022-08-25 12:58:36 +08:00
zeertzjq
711635872d vim-patch:8.1.1085: compiler warning for possibly uninitialized variable
Problem:    Compiler warning for possibly uninitialized variable. (Tony
            Mechelynck)
Solution:   Make conditions more logical.
bd9bf266fc
2022-08-25 12:53:34 +08:00
zeertzjq
e4e0e8ce6f
refactor: ins_compl_show_pum() (#19938)
This marks the remaining part of Vim patch 8.2.3953 as ported, because
ins_compl_upd_pum() has been removed.

vim-patch:8.2.3953: insert completion code is too complicated

Problem:    Insert completion code is too complicated.
Solution:   More refactoring.  Move function arguments into a struct.
            (Yegappan Lakshmanan, closes vim/vim#9437)
6ad84ab3e4
2022-08-25 12:07:49 +08:00
zeertzjq
ee02141c7b
Merge pull request #19937 from zeertzjq/vim-8.2.3942
vim-patch:8.2.{3942,partial:4001}
2022-08-25 11:17:29 +08:00
zeertzjq
b1833bb33b vim-patch:partial:8.2.4001: insert complete code uses global variables
Problem:    Insert complete code uses global variables.
Solution:   Make variables local to the file and use accessor functions.
            (Yegappan Lakshmanan, closes vim/vim#9470)
d94fbfc74a

Skip changes in comments for callback-related functions (not ported).
Also make compl_busy static again.
2022-08-25 10:15:07 +08:00
zeertzjq
45d09b46ce vim-patch:8.2.3942: Coverity reports a possible memory leak
Problem:    Coverity reports a possible memory leak.
Solution:   Free the array if allocation fails.
8e7cc6b920
2022-08-25 10:15:07 +08:00
zeertzjq
674d3b2d5f
Merge pull request #19936 from zeertzjq/vim-8.2.3989
vim-patch:8.2.{2534,3989,4037}: Insert mode completion tests and fixes
2022-08-25 08:54:03 +08:00
zeertzjq
3290e472c0 vim-patch:8.2.4037: Insert mode completion is insufficiently tested
Problem:    Insert mode completion is insufficiently tested.
Solution:   Add more tests.  Fix uncovered memory leak. (Yegappan Lakshmanan,
            closes vim/vim#9489)
370791465e
2022-08-25 08:27:44 +08:00
zeertzjq
cabc1861c4 vim-patch:8.2.3989: some insert completion code is not tested
Problem:    Some insert completion code is not tested.
Solution:   Add a few tests.  Refactor thesaurus completion. (Yegappan
            Lakshmanan, closes vim/vim#9460)
e982586f8e

vim-patch:9.0.0254: typo in function name

Problem:    Typo in function name.
Solution:   Rename the function. (closes vim/vim#10971)
5fb3aabc2b
2022-08-25 08:27:44 +08:00
zeertzjq
6c9a91bebe vim-patch:8.2.2534: missing test coverage
Problem:    Missing test coverage.
Solution:   Improve test coverage for completion with different encodings,
            mapset(), and term function failures. (Dominique Pellé,
            closes vim/vim#7877)
a1070eae77

Cherry-pick E716 -> E715 change from patch 8.2.4861.
2022-08-25 08:27:43 +08:00
zeertzjq
6d8b64fffc
Merge pull request #19927 from zeertzjq/vim-9.0.0045
vim-patch:9.0.{0045,0046,0060,0102}: Insert mode completion crash fixes
2022-08-25 07:17:52 +08:00
zeertzjq
dd77a00621 vim-patch:9.0.0102: reading past end of line with insert mode completion
Problem:    Reading past end of line with insert mode completion.
Solution:   Check text length.
a6f9e30016
2022-08-25 06:53:59 +08:00
zeertzjq
6680002169 vim-patch:9.0.0060: accessing uninitialized memory when completing long line
Problem:    Accessing uninitialized memory when completing long line.
Solution:   Terminate string with NUL.
b9e717367c
2022-08-25 06:53:59 +08:00
zeertzjq
5d1f0c3eca vim-patch:9.0.0046: reading past end of completion with duplicate match
Problem:    Reading past end of completion with duplicate match.
Solution:   Check string length
baefde1455
2022-08-25 06:53:59 +08:00
zeertzjq
c366a63e4c vim-patch:9.0.0045: reading past end of completion with a long line
Problem:    Reading past end of completion with a long line and 'infercase'
            set.
Solution:   Allocate the string if needed.
caea66442d

Cherry-pick the deletion of a blank line from patch 9.0.0027.

N/A patches for version.c:

vim-patch:9.0.0054: compiler warning for size_t to int conversion

Problem:    Compiler warning for size_t to int conversion.
Solution:   Add type cast. (Mike Williams, closes vim/vim#10741)
c7bd2f08e5
2022-08-25 06:53:59 +08:00
Christian Clason
d3cd79709b
vim-patch:fd999452adaf (#19929)
Update runtime files
fd999452ad
2022-08-25 00:49:33 +02:00
zeertzjq
6b9ff5491d
fix(treesitter): free memory on removing parser (#19933)
This fixes the ASAN failure.
2022-08-25 06:41:04 +08:00
bfredl
c545d514df
Merge pull request #19830 from lewis6991/hlgroup_name
feat(highlight)!: error on invalid names and allow '.' and '@'
2022-08-24 21:08:21 +02:00
Thomas Vigouroux
3b2121cedf
Merge pull request #19928 from vigoux/ts-fix-c-parser
test(treesitter): make internal lang test pending when necessary
2022-08-24 19:05:58 +02:00
Lewis Russell
61be343ec8 feat(highlight)!: error on invalid names and allow '.' and '@'
Previously if a highlight group with a name outside the regexp
[a-zA-Z0-9_] was defined, Nvim would emit an "invalid character"
warning message. This was annoying for Lua scripts, as it was very hard
to debug what line of code was triggering this message since it didn't
produce a stack trace.

This has now been promoted to an error with the code E5248.

Additionally the ASCII character period ('.') and at-sign ('@') have
been added to the allowed list of characters of a highlight group name
to support the application of defining hierarchical highlight groups,
e.g. 'TS.keyword'.

Co-authored-by: Christian Clason <christian.clason@uni-due.de>
2022-08-24 17:13:18 +01:00