Commit Graph

22796 Commits

Author SHA1 Message Date
Christian Clason
6a13b8fa54
vim-patch:7dd543246a4c (#19960)
Update runtime files
7dd543246a
2022-08-26 19:58:10 +02:00
zeertzjq
0b72e23bf1
vim-patch:8.2.0674: some source files are too big (#19959)
Problem:    Some source files are too big.
Solution:   Move text formatting functions to a new file. (Yegappan
            Lakshmanan, closes vim/vim#6021)
11abd09521

Cherry-pick set_can_cindent() from patch 8.1.2062.
Cherry-pick global old_indent from patch 8.2.2127.
2022-08-26 22:37:20 +08:00
bfredl
2ecb4076df
Merge pull request #19931 from bfredl/scopedhl
feat(highlight)!: use scoped @foo.bar.special groups for tree-sitter highlight
2022-08-26 14:43:58 +02:00
bfredl
b04ef7f6b9 fix(treesitter): make it get_captures_at_position 2022-08-26 13:57:31 +02:00
Quentin Rasmont
064ecb9ec5 feat(treesitter): upstream get_hl_groups_at_position()
Util from the nvim-treesitter project.
2022-08-26 13:57:31 +02:00
bfredl
030b422d1e feat(treesitter)!: use @foo.bar style highlight groups
This removes the support for defining links via
vim.treesitter.highlighter.hl_map (never documented, but plugins did
anyway), or the uppercase-only `@FooGroup.Bar` to `FooGroup` rule.

The fallback is now strictly `@foo.bar.lang` to `@foo.bar` to `@foo`,
and casing is irrelevant (as it already was outside of treesitter)

For compatibility, define default links to builting syntax groups
as defined by pre-existing color schemes
2022-08-26 13:57:31 +02:00
bfredl
914ba18a49 feat(highlight): support scoped @spam.eggs.baked_beans groups 2022-08-26 13:57:31 +02:00
zeertzjq
6547f4397f
vim-patch:8.1.2331: the option.c file is still very big (#19954)
Problem:    The option.c file is still very big.
Solution:   Move a few functions to where they fit better. (Yegappan
            Lakshmanan, closes vim/vim#4895)
7bae0b1bc8

vim-patch:9.0.0271: using INIT() in non-header files

Problem:    Using INIT() in non-header files.
Solution:   Remove INIT(). (closes vim/vim#10981)
9b7d2a9596
2022-08-26 18:49:29 +08:00
Lewis Russell
06d5c6332d
Merge pull request #19947 from lewis6991/truefalse 2022-08-26 11:11:14 +01:00
Lewis Russell
2498e9feb0 refactor: change FALSE/TRUE to false/true
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-08-26 09:36:55 +01:00
zeertzjq
946c0aa66f
Merge pull request #19953 from zeertzjq/vim-9.0.0036
vim-patch:8.2.2524,9.0.(0036,0037,0038,0040}
2022-08-26 10:46:18 +08:00
zeertzjq
36fdad5575 vim-patch:9.0.0040: use of set_chars_option() is confusing
Problem:    Use of set_chars_option() is confusing.
Solution:   Add "apply" argument to store the result or not.  Merge similar
            code.
b67f0c8e49
2022-08-26 10:15:02 +08:00
zeertzjq
db28c2ca2b refactor: set_chars_option()
Rename "set" to "apply" and tidy up variable scopes.
2022-08-26 10:14:59 +08:00
zeertzjq
752d397cae vim-patch:9.0.0038: 'listchars' test fails
Problem:    'listchars' test fails.
Solution:   Use window-local value after setting the global value
5ed26faace
2022-08-26 10:14:59 +08:00
zeertzjq
fa1c761d62 vim-patch:9.0.0036: 'fillchars' cannot have window-local values
Problem:    'fillchars' cannot have window-local values.
Solution:   Make 'fillchars' global-local. (closes vim/vim#5206)
96ba25ac01

Cherry-pick g:run_nr from patch 8.2.0454.

N/A patches for version.c:

vim-patch:9.0.0037: build error

Problem:    Build error.
Solution:   Add missing change.
510f03738d
2022-08-26 10:14:59 +08:00
zeertzjq
1ba3d5c712 vim-patch:8.2.2524: cannot change the characters displayed in the foldcolumn
Problem:    Cannot change the characters displayed in the foldcolumn.
Solution:   Add fields to 'fillchars'. (Yegappan Lakshmanan, Matthieu Coudron,
            closes vim/vim#7860)
3aca5a6fbc
2022-08-26 10:14:58 +08:00
zeertzjq
c12f6002a1
Merge pull request #19950 from zeertzjq/vim-9.0.0270
vim-patch:9.0.{0262,0263,0266,0268,0270}: too many #ifdefs
2022-08-26 07:37:57 +08:00
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