Commit Graph

3131 Commits

Author SHA1 Message Date
zeertzjq
2c9fbe34b2
vim-patch:8.2.2336: Vim9: not possible to extend dictionary with different type (#22425)
Problem:    Vim9: it is not possible to extend a dictionary with different
            item types.
Solution:   Add extendnew(). (closes vim/vim#7666)

b0e6b51364

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-27 10:10:42 +08:00
zeertzjq
13da3d469a vim-patch:partial:9.0.0202: code and help for indexof() is not ideal
Problem:    Code and help for indexof() is not ideal.
Solution:   Refactor the code, improve the help. (Yegappan Lakshmanan,
            closes vim/vim#10908)

3fbf6cd355

Skip CHECK_LIST_MATERIALIZE and set_vim_var_type().
Use tv_list_uidx() instead of lv_idx.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-27 07:53:17 +08:00
zeertzjq
0972d7a124 vim-patch:9.0.0196: finding value in list may require a for loop
Problem:    Finding value in list may require a for loop.
Solution:   Add indexof(). (Yegappan Lakshmanan, closes vim/vim#10903)

b218655d5a

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-27 07:34:59 +08:00
Lewis Russell
774e59f3f9
feat(treesitter): expand the API 2023-02-26 16:53:33 +00:00
Mathias Fußenegger
c1514d7e67
fix(lsp): fix some type annotations (#22397) 2023-02-25 18:47:05 +01:00
Mathias Fussenegger
f0f27e9aef Revert "feat(lsp): implement workspace/didChangeWatchedFiles (#21293)"
This reverts commit 5732aa706c.

Causes editor to freeze in projects with many watcher registrations
2023-02-25 11:17:28 +01:00
Jon Huhn
5732aa706c
feat(lsp): implement workspace/didChangeWatchedFiles (#21293) 2023-02-25 10:07:18 +01:00
Lewis Russell
c57af5d41c
feat(treesitter)!: remove silent option from language.add()
Simply use `pcall` if you want to silence an error.
2023-02-24 09:50:59 +00:00
zeertzjq
904d099583 vim-patch:8.2.2449: Vim9: flatten() always changes the list type
Problem:    Vim9: flatten() always changes the list type.
Solution:   Disallow using flatten() and add flattennew().

3b69006973

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-24 15:36:08 +08:00
Lewis Russell
1df3f5ec6a
feat(treesitter): upstream foldexpr from nvim-treesitter 2023-02-23 17:05:20 +00:00
Christian Clason
6dfbeb0d99 docs: fix more treesitter parsing errors 2023-02-23 10:25:22 +01:00
Christian Clason
1c37553476 test(help): drop treesitter parse error to 0
All parser errors have been fixed; make sure we don't introduce new
ones.
2023-02-23 10:24:15 +01:00
bfredl
799edca18a feat(lua): make sure require'bit' always works, even with PUC lua 5.1 2023-02-22 22:15:19 +01:00
Justin M. Keyes
09b6a68c37
Merge #21428 docs: naming conventions, guidelines 2023-02-22 10:40:01 -05:00
Justin M. Keyes
6752f1005d docs: naming conventions, guidelines
close #21063
2023-02-22 16:23:49 +01:00
Luuk van Baal
0b36145c69 docs: mention getmousepos() for click execute function label
close #18741
close #11312
2023-02-22 16:23:49 +01:00
Justin M. Keyes
b496605fea docs: vim_diff.txt 2023-02-22 16:23:49 +01:00
Gregory Anders
675826da63
refactor(treesitter): Add vim.treesitter.get_node() (#22360)
This function replaces both vim.treesitter.get_node_at_pos() and
vim.treesitter.get_node_at_cursor(). These two functions are similar
enough that they don't need separate interfaces. Even worse,
get_node_at_pos() returns a TSNode while get_node_at_cursor() returns a
string, so the two functions behave slightly differently.

vim.treesitter.get_node() combines these two into a more streamlined
interface. With no arguments, it returns the node under the cursor in
the current buffer. Optionally, it can accept a buffer number or a
position to get the node at a given position in a given buffer.
2023-02-22 08:01:08 -07:00
Lewis Russell
8714a4009c
feat(treesitter): add filetype -> lang API
Problem:

  vim.treesitter does not know how to map a specific filetype to a parser.

  This creates problems since in a few places (including in vim.treesitter itself), the filetype is incorrectly used in place of lang.

Solution:

  Add an API to enable this:

  - Add vim.treesitter.language.add() as a replacement for vim.treesitter.language.require_language().
    - Optional arguments are now passed via an opts table.
    - Also takes a filetype (or list of filetypes) so we can keep track of what filetypes are associated with which langs.
    - Deprecated vim.treesitter.language.require_language().
  - Add vim.treesitter.language.get_lang() which returns the associated lang for a given filetype.
  - Add vim.treesitter.language.register() to associate filetypes to a lang without loading the parser.
2023-02-21 17:09:18 +00:00
zeertzjq
344a1ee8e6
docs: fix typos (#22353) 2023-02-22 00:07:26 +08:00
zeertzjq
ee26b227e1
vim-patch:partial:938ae280c79b (#22356)
Update runtime files.

938ae280c7

Partially skip autocmd.txt: needs patch 8.2.5011.
Partially skip builtin.txt: needs patch 9.0.0411.
Partially skip eval.txt: needs patch 8.2.3783.
Cherry-pick :map-meta-keys from patch 9.0.1276.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-21 23:50:29 +08:00
zeertzjq
f1816f9ee2
refactor(main.c): remove unreachable use_builtin_ui conditions (#22338)
When use_builtin_ui is true, Nvim will exit before line 385 is reached.
2023-02-20 15:13:55 +08:00
dundargoc
b62c0c8d9c
docs: fix typos (#21961)
Co-authored-by: Ben Morgan <cassava@iexu.de>
2023-02-20 15:12:59 +08:00
Jonas Strittmatter
bcae4af374
docs: remove mentions of 'balloonexpr' #22049
'balloonexpr' option was removed in Nvim.
2023-02-16 06:54:25 -08:00
Ghjuvan Lacambre
d34c64e342
feat: $NVIM_APPNAME #22128
This commit implements the ability to control all of the XDG paths
Neovim should use. This is done by setting an environment variable named
NVIM_APPNAME. For example, setting $NVIM_APPNAME makes Neovim look for
its configuration directory in $XDG_CONFIG_HOME/$NVIM_APPNAME instead of
$XDG_CONFIG_HOME/nvim.

If NVIM_APPNAME is not set or is an empty string, "nvim" will be used as
default.

The usecase for this feature is to enable an easy way to switch from
configuration to configuration. One might argue that the various $XDG
environment variables can already be used for this usecase. However,
setting $XDG environment variables also affects tools spawned by Neovim.
For example, while setting $XDG_CONFIG_HOME will enable Neovim to use a
different configuration directory, it will also prevent Git from finding
its "default" configuration.

Closes https://github.com/neovim/neovim/issues/21691
2023-02-16 04:15:02 -08:00
Lewis Russell
a289e82142
fix(treesitter): make params optional 2023-02-15 12:26:07 +00:00
zeertzjq
374955bcc5
vim-patch:9.0.1300: 'statusline' only supports one "%=" item (#22218)
Problem:    'statusline' only supports one "%=" item.
Solution:   Add support for multiple "%=" items. (TJ DeVries, Yegappan
            Lakshmanan, closes vim/vim#11970, closes vim/vim#11965)

3ec78f973f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-11 20:00:31 +08:00
zeertzjq
7d58de11f4
fix(rpc)!: preseve files when stdio channel is closed (#22137)
BREAKING CHANGE: Unsaved changes are now preserved rather than discarded
when stdio channel is closed.
2023-02-11 18:25:01 +08:00
Sizhe Zhao
165b07b269
docs: reword news.txt to ensure a consistent style (#22215) 2023-02-11 10:34:20 +01:00
Christian Clason
2af31fc50a
Merge pull request #22186 from clason/maintain
* docs(maintain): add note on updating `luvref.txt`
* docs(luvref): update version info
2023-02-09 13:15:29 +01:00
Christian Clason
1aa128b0ea docs(luvref): update version info 2023-02-09 11:54:37 +01:00
bfredl
7404f481ba
Merge pull request #22172 from bfredl/cells
perf(ui): mitigate redraw latency regression from TUI refactor
2023-02-08 18:36:36 +01:00
bfredl
625e990976 refactor(ui): cleanup 'redrawdebug', introduce "flush" mode 2023-02-08 18:02:55 +01:00
Christian Clason
d0008bd626 docs(luvref): update to version bump 2023-02-08 11:28:32 +01:00
Christian Clason
e1f03c481a
feat(spell): also source spell/LANG.lua when setting spelllang (#22111)
Problem: only Vimscript files are sourced when setting spelling language
Solution: also source Lua files after sourcing Vimscript files

Closes #22110
2023-02-06 10:01:38 +01:00
figsoda
e1d5ad1cb8 feat(treesitter): add metadata option for get_node_text 2023-02-04 21:15:03 -05:00
figsoda
bb8845340b feat(treesitter): allow capture text to be transformed
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-02-04 21:04:45 -05:00
Lewis Russell
9a5678463c
fix(treesitter): fix most diagnostics 2023-02-04 14:58:38 +00:00
Christian Clason
144279ef30
vim-patch:be4e01637e71 (#22103)
Update runtime files.

be4e01637e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-03 09:18:18 +01:00
Thayne McCombs
cb97d5425a docs: clarify "pipe" mode for sockconnect
Make it more clear that on unix the "pipe" mode of sockconnect uses unix
local domain sockets, not named pipes (FIFOs) which are not currently
supported.

See discussion in #22080.

Signed-off-by: Thayne McCombs
2023-02-02 01:00:17 -07:00
bfredl
8376486e8f
Merge pull request #17537 from bfredl/neolua
refactor(tests): run unittests using main nvim binary - delete separate nvim-test build
2023-01-31 19:58:33 +01:00
bfredl
d6d6ab3f8e feat(lua): low-level interpreter mode (nvim -ll) 2023-01-31 13:53:22 +01:00
Christian Clason
c032e83b22 fix(treesitter): validate language name
Problem: Some injections (like markdown) allow specifying arbitrary
language names for code blocks, which may be lead to errors when
looking for a corresponding parser in runtime path.

Solution: Validate that the language name only contains alphanumeric
characters and `_` (e.g., for `c_sharp`) and error otherwise.
2023-01-28 11:28:52 +01:00
Lewis Russell
aec4b476c5
docs(api): tweak data arg for nvim_create_autocmd (#22008)
Fixes #21964
2023-01-27 11:24:20 +00:00
zeertzjq
e02df23b4e
docs: clarify :runtime behavior without [where] again (#22003)
The behavior changed again after #15867, change the docs to describe
latest behavior.
2023-01-26 19:35:06 +08:00
zeertzjq
f03f6263bb vim-patch:9.0.1238: :runtime completion can be further improved
Problem:    :runtime completion can be further improved.
Solution:   Also complete the {where} argument values and adjust the
            completion for that. (closes vim/vim#11874)

5c8771bc5a
2023-01-26 11:55:34 +08:00
zeertzjq
6320c91c50 vim-patch:9.0.1231: completion of :runtime does not handle {where} argument
Problem:    Completion of :runtime does not handle {where} argument.
Solution:   Parse the {where} argument. (closes vim/vim#11863)

3770f4c9cd
2023-01-26 11:55:34 +08:00
C.D. MacEachern
314d3ce1eb
docs(vim.fs): normalize Windows example was incorrect (#21966) 2023-01-25 06:45:30 +08:00
Lewis Russell
9166116c67
doc(lsp): format arguments to start_client() (#21980)
docs(lsp): format arguments to start_client()
2023-01-24 18:04:15 +00:00
Paul "LeoNerd" Evans
f3039ce531 feat(highlight): define the concept of altfont as a (c)term rendering attribute 2023-01-24 11:27:50 +00:00