Commit Graph

4637 Commits

Author SHA1 Message Date
Jonas Strittmatter
ce80b8f50d
vim-patch:9.0.0349: filetype of *.sil files not well detected (#20050)
Problem:    Filetype of *.sil files not well detected.
Solution:   Inspect the file contents to guess the filetype.
be807d5824
2022-09-02 08:16:17 +02:00
zeertzjq
689f5d604e feat(api): add support for :horizontal modifier 2022-09-01 20:53:43 +08:00
zeertzjq
56bf026dea vim-patch:9.0.0346: :horizontal modifier not fully supported
Problem:    :horizontal modifier not fully supported.
Solution:   Also use :horizontal for completion and user commands.
            (closes vim/vim#11025)
d3de178e53
2022-09-01 20:28:23 +08:00
zeertzjq
c65b1f3e15 vim-patch:9.0.0342: ":wincmd =" equalizes in two directions
Problem:    ":wincmd =" equalizes in two directions.
Solution:   Make ":vertical wincmd =" equalize vertically only and
            ":horizontal wincmd =" equalize horizontally only.
21c3a80a7f
2022-09-01 20:25:29 +08:00
zeertzjq
0c6b39894f
feat(mapset): support restoring Lua callback (#20024)
vim-patch:9.0.0341: mapset() does not restore <Nop> mapping properly

Problem:    mapset() does not restore <Nop> mapping properly.
Solution:   Use an empty string for <Nop>. (closes vim/vim#11022)
92a3d20682
2022-09-01 06:19:49 +08:00
bfredl
f31db30975 feat(lua): vim.ui_attach to get ui events from lua
Co-authored-by: Famiu Haque <famiuhaque@protonmail.com>
2022-08-31 20:40:17 +02:00
Christian Clason
0903702634
vim-patch:9b03d3e75b42 (#20013)
Update runtime files
9b03d3e75b
2022-08-31 08:08:51 +02:00
Christian Clason
6b7eed1884
Vim 9.0.{0314,0319}: some filetypes are not recognized (#20005)
* vim-patch:9.0.0314: VDM files are not recognized

Problem:    VDM files are not recognized.
Solution:   Add patterns for VDM files. (Alessandro Pezzoni, closes vim/vim#11004)
bf26941f40

* vim-patch:9.0.0319: Godot shader files are not recognized

Problem:    Godot shader files are not recognized.
Solution:   Add patterns for "gdshader". (Maxim Kim, closes vim/vim#11006)
d5c8f11905
2022-08-30 21:16:03 +02:00
Christian Clason
9397e70b9e
docs(lua): present vim.o as default and vim.opt as special-purpose #19982
Problem: People are confused about `vim.o` and `vim.opt`
Solution: Clarify that `vim.o` is the default interface, with `vim.opt`
          specifically meant for interacting with list-style options.
2022-08-30 05:46:38 -07:00
Mathias Fußenegger
981ae83fad
fix(docs): update lsp.rpc.start docs to match return value changes (#20003)
Follow up to https://github.com/neovim/neovim/pull/19916
2022-08-30 13:14:27 +02:00
Mathias Fußenegger
0368ca70c4
docs(lsp): replace formatting_sync example in lsp-faq (#19994)
`formatting_sync` is deprecated
2022-08-30 13:14:09 +02:00
Raphael
efacb6e974
fix(lsp): clean the diagnostic cache when buffer delete (#19449)
Co-authored-by: Gregory Anders <greg@gpanders.com>
2022-08-29 19:09:14 +02:00
Mathias Fußenegger
126fe7fbc9
Merge pull request #19916 from mfussenegger/lsp-tcp
Adds TCP support for lsp.
Usage example:

```
vim.lsp.start({ name = 'godot', cmd = vim.lsp.rpc.connect('127.0.0.1', 6008) })
```
2022-08-29 18:26:14 +02:00
Shougo
253f0ffd8d
vim-patch:9.0.0285: it is not easy to change the command line from a plugin (#19979)
vim-patch:9.0.0285: it is not easy to change the command line from a plugin

Problem:    It is not easy to change the command line from a plugin.
Solution:   Add setcmdline(). (Shougo Matsushita, closes vim/vim#10869)
07ea5f1509
2022-08-29 13:11:52 +08:00
Mathias Fussenegger
60ec6e34d5 feat(lsp): add tcp support 2022-08-28 14:07:53 +02:00
Mathias Fussenegger
46bb34e26b refactor(lsp): extract rpc client from rpc.start
Makes the previously inner functions re-usable for a TCP client
2022-08-28 14:07:53 +02:00
Mathias Fussenegger
7d3e4aee6a refactor(lsp): encapsulate rpc uv handle
To prepare for different transports like TCP where the handle won't have
a kill method.
2022-08-28 14:07:53 +02:00
Mathias Fussenegger
f9641d1ac6 refactor(lsp): factor out read_loop function 2022-08-28 14:07:53 +02:00
dundargoc
09c6ce8c4e
docs: fix typos (#19798)
Co-authored-by: adrian5 <adrian5@users.noreply.github.com>
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2022-08-27 15:56:58 +08:00
zeertzjq
cc2c8be481 vim-patch:9.0.0279: the tiny version has the popup menu but not 'wildmenu'
Problem:    The tiny version has the popup menu but not 'wildmenu'.
Solution:   Graduate the wildmenu feature.
5416232707

N/A patches for version.c:

vim-patch:9.0.0281: build failure without the +eval feature

Problem:    Build failure without the +eval feature.
Solution:   Add #ifdef.
58dcbf1c65
2022-08-27 07:03:07 +08:00
Christian Clason
6a13b8fa54
vim-patch:7dd543246a4c (#19960)
Update runtime files
7dd543246a
2022-08-26 19:58:10 +02: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
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
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
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
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
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
Christian Clason
d3cd79709b
vim-patch:fd999452adaf (#19929)
Update runtime files
fd999452ad
2022-08-25 00:49:33 +02: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
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
Lewis Russell
b1eaa2b9a3
feat(lua): add vim.iconv (#18286)
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-08-24 14:41:31 +01:00
Thomas Vigouroux
9be4bfc5f4
Merge pull request #19496 from vigoux/ts_internal_lang
feat(treesitter): allow customizing language symbol name
2022-08-24 15:36:58 +02:00
Simon Wachter
e892b7b383
fix(inspect): escape identifiers that are lua keywords (#19898)
A lua keyword is not a valid table identifier
2022-08-23 13:02:55 +02:00
zeertzjq
7afc17dec1 vim-patch:8.2.4741: startup test fails
Problem:    Startup test fails.
Solution:   Avoid an error for verbose expansion.  Fix that the "0verbose"
            command modifier doesn't work.
60895f3e36

Most code changes has already been ported.
2022-08-23 17:48:12 +08:00
zeertzjq
a9e6cf0e64 vim-patch:8.2.4740: when expand() fails there is no error message
Problem:    When expand() fails there is no error message.
Solution:   When 'verbose' is set give an error message.
575445200b
2022-08-23 17:48:12 +08:00
zeertzjq
ffa1335047 vim-patch:8.2.4726: cannot use expand() to get the script name
Problem:    Cannot use expand() to get the script name.
Solution:   Support expand('<script>'). (closes vim/vim#10121)
6013d0045d

Use `.sn_name` instead of `->sn_name` as v8.2.0154 hasn't been ported.
Cherry-pick builtin.txt expand() doc from latest Vim.
2022-08-23 17:47:46 +08:00
zeertzjq
48a4657aee
vim-patch:8.1.{1915,1921,1953} (#19900)
vim-patch:8.1.1915: more functions can be used as methods

Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
1a3a89168d

Move debugbreak() to the right place.

vim-patch:8.1.1921: more functions can be used as methods

Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
a4208966fb

vim-patch:8.1.1953: more functions can be used as a method

Problem:    More functions can be used as a method.
Solution:   Allow more functions to be used as a method.
f9f24ce7a0

Omit test_termcodes.vim: cannot be used and superseded by later patches.
Cherry-pick test_bufline.vim change from patch 8.1.1993.
2022-08-23 08:36:22 +08:00
Thomas Vigouroux
3c1d70f20b
feat(treesitter): allow customizing language symbol name 2022-08-22 15:34:10 +02:00
zeertzjq
e3eb6967bc
vim-patch:8.2.4325: 'wildmenu' only shows few matches (#19876)
Problem:    'wildmenu' only shows few matches.
Solution:   Add the "pum" option: use a popup menu to show the matches.
            (Yegappan Lakshmanan et al., closes vim/vim#9707)
3908ef5017

Omit p_wmnu check in cmdline_pum_active() as it can cause problems.
Omit vim_strchr() flags as that isn't really better than bitmasks.
Omit key translations and document it in vim_diff.txt.
2022-08-21 21:31:25 +08:00
Christian Clason
1cc4706e94
vim-patch:e80086446cc2 (#19848)
* vim-patch:e80086446cc2

Update runtime files
e80086446c

Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2022-08-20 10:04:55 +02:00
zeertzjq
15ca01b649 vim-patch:8.2.4667: expandcmd() fails on an error
Problem:    expandcmd() fails on an error.
Solution:   On failure return the command unmodified. (yegappan Lakshmanan,
            closes vim/vim#10063)
5018a836c0
2022-08-20 07:25:22 +08:00
zeertzjq
e8618df7f8
vim-patch:8.2.3619: cannot use a lambda for 'operatorfunc' (#19846)
Problem:    Cannot use a lambda for 'operatorfunc'.
Solution:   Support using a lambda or partial. (Yegappan Lakshmanan,
            closes vim/vim#8775)
777175b0df

Omit duplicate docs. It's removed in patch 8.2.3623.
Nvim doesn't seem to need callback_set() as it was omitted when patch 8.1.1437
was first ported.
2022-08-20 06:12:02 +08:00
Christian Clason
b2f979b30b
fix(filetype): only check first 100 and last line of buffer (#19819)
fix(filetype): only pass first 100 and last lines to contents check

sufficient for current content checks and avoids performance issues for
buffers with a large number of lines

fixes #19817
2022-08-19 19:30:35 +02:00