Commit Graph

24911 Commits

Author SHA1 Message Date
bfredl
f3476f2f99
Merge pull request #22408 from bfredl/ui_log
refactor(ui): ui_log() can now just be a function
2023-02-26 11:32:01 +01:00
dundargoc
1d8b77da6b
fix(MSVC): set the active code page to utf-8 (#22384)
Neovim expects character encoding to be UTF-8, and deviation from this
causes bugs such as lua files not being recognized for non-ascii paths.
This changes the behavior of fopen, which defaults to using the
currently active codepage.

Closes: https://github.com/neovim/neovim/issues/18122
2023-02-26 08:12:41 +08:00
bfredl
6942528a54 refactor(ui): ui_log() can now just be a function 2023-02-25 23:29:00 +01:00
Mathias Fußenegger
c1514d7e67
fix(lsp): fix some type annotations (#22397) 2023-02-25 18:47:05 +01:00
Mathias Fußenegger
db32d312ac
ci(fix): repair regen-api-docs (#22403)
https://github.com/neovim/neovim/pull/22398 broke the job because there
is no `build/bin/nvim`

This keeps the preference for `build/bin/nvim` but adds back `nvim` as
fallback if it doesn't exist.
2023-02-25 17:24:43 +01:00
Mathias Fußenegger
2708507e87
docs: use build/bin/nvim instead of nvim in gen_vimdoc (#22398)
Problem:

`nvim` could point to stable release missing the `nvim -l`
functionality.

Solution:

Require to build nvim first and use `build/bin/nvim`
2023-02-25 16:35:45 +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
dundargoc
a601d03112
build: build luajit in parallel (#22327)
Add -j flag to the make command for luajit. Cuts down dependency build time by 40% when using the Ninja generator.
2023-02-24 21:17:23 +01:00
Christian Clason
15cce77b38
vim-patch:9.0.1351: Dhall files are not recognized (#22393)
Problem:    Dhall files are not recognized.
Solution:   Add patterns for Dhall files. (Amaan Qureshi, closes vim/vim#12052)

def5521752

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-02-24 17:50:37 +01:00
Christian Clason
4297127f14
vim-patch:9.0.1350: CPON files are not recognized (#22392)
Problem:    CPON files are not recognized.
Solution:   Add patterns for CPON files. (Amaan Qureshi, closes vim/vim#12053)

c2254764bc

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-02-24 15:34:52 +01:00
Raphael
1803dadb20
refactor(lsp): remove deprecated code (#22389) 2023-02-24 12:55:50 +01:00
Mark Naughton
04a6369da5
refactor(PVS/V581): merge identical if statements (#22390) 2023-02-24 19:05:39 +08: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
306e673583
Merge pull request #22386 from zeertzjq/vim-8.2.2449
vim-patch:8.2.{2449,4627,4629,4632}: flattennew(), flatten() fixes
2023-02-24 16:01:47 +08:00
zeertzjq
c76dfe14b1 vim-patch:8.2.4632: using freed memory in flatten()
Problem:    Using freed memory in flatten().
Solution:   Clear typval after recursing into list.

f3980dc5d0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-24 15:36:08 +08:00
zeertzjq
ec25572367 vim-patch:8.2.4629: flattennew() makes a deep copy unnecessarily
Problem:    flattennew() makes a deep copy unnecessarily.
Solution:   Use a shallow copy. (issue vim/vim#10012)

c6c1ec4da5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-24 15:36:08 +08:00
zeertzjq
d9263688bf vim-patch:8.2.4627: flatten() does not use maxdepth correctly
Problem:    flatten() does not use maxdepth correctly.
Solution:   Use a recursive implementation. (closes vim/vim#10020)

acf7d73a7f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-24 15:36:08 +08: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
zeertzjq
47bc297d81
vim-patch:8.2.4318: various comment and indent mistakes, returning wrong zero (#22385)
Problem:    Various comment and indent mistakes, returning wrong zero.
Solution:   Fix the mistakes.  Return NULL instead of FAIL.

54969f4ef5

N/A patches for version.c:

vim-patch:8.2.3781: the option window script is outdated

Problem:    The option window script is outdated.
Solution:   Add several changes.

a416861c64

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-24 12:35:06 +08:00
Amaan Qureshi
5e1308b7ca
vim-patch:9.0.1348: Un-grammar files are not recognized (#22383)
Problem:    Un-grammar files are not recognized.
Solution:   Add patterns for Un-grammar files. (Amaan Qureshi, closes vim/vim#12034)

44e08c1cf8
2023-02-23 22:12:01 +01:00
Lewis Russell
3f35ebb14d
fix(treesitter): fixup language invalidation (#22381) 2023-02-23 18:09:44 +00:00
Lewis Russell
1df3f5ec6a
feat(treesitter): upstream foldexpr from nvim-treesitter 2023-02-23 17:05:20 +00:00
Christian Clason
8c339aa04b
vim-patch:9.0.1346: Starlark files are not recognized (#22380)
Problem:    Starlark files are not recognized.
Solution:   Add patterns for Starlark files. (Amaan Qureshi, closes vim/vim#12049)

ca06b30073

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-02-23 17:52:33 +01:00
Lewis Russell
75e53341f3
perf(treesitter): smarter languagetree invalidation
Problem:
  Treesitter injections are slow because all injected trees are invalidated on every change.

Solution:
    Implement smarter invalidation to avoid reparsing injected regions.

    - In on_bytes, try and update self._regions as best we can. This PR just offsets any regions after the change.
    - Add valid flags for each region in self._regions.
    - Call on_bytes recursively for all children.
       - We still need to run the query every time for the top level tree. I don't know how to avoid this. However, if the new injection ranges don't change, then we re-use the old trees and avoid reparsing children.

This should result in roughly a 2-3x reduction in tree parsing when the comment injections are enabled.
2023-02-23 15:19:52 +00:00
Lewis Russell
8680715743
fix: resolve error from -Werror=maybe-uninitialized 2023-02-23 15:08:39 +00:00
Mathias Fußenegger
f140175564
refactor(lsp): remove workaround for missing bit module (#22373) 2023-02-23 13:35:46 +01:00
Christian Clason
0cd0fdf478
Merge pull request #22357 from clason/docs-ts
* Work around tree-sitter-vimdoc parsing errors introduced in a recent PR.
* Drop the tolerance of the test to 0 to make sure this doesn't happen again.
2023-02-23 13:02:15 +01: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
Christian Clason
05de0f4fea docs(treesitter): fix parse errors 2023-02-23 10:24:15 +01:00
zeertzjq
524e1a0643
fix(highlight): avoid ORing underline flags (#22372)
When combining attributes use the one that takes priority.
For :highlight command use the last one specified.
For API use a hard-coded order same as the order in docs.
2023-02-23 16:15:04 +08:00
bfredl
d422fc8274
Merge pull request #21222 from bfredl/bitband
feat(lua): make sure require'bit' always works, even on PUC LUA 5.1
2023-02-22 22:38:21 +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
Christian Clason
2281669470
build(deps): bump LuaJIT to HEAD - 505e2c03d (#22362) 2023-02-22 14:44:11 +01:00
Christian Clason
d1b34b7458
vim-patch:9.0.1337: yuck files are not recognized (#22358)
Problem:    Yuck files are not recognized.
Solution:   Add a filetype pattern for yuck files. (Amaan Qureshi,
            closes vim/vim#12033)

cfce5cf542

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-02-22 10:58:15 +01:00
dundargoc
649742821a
docs: remove the test badge from the README (#22350)
Tests are flaky, and a failure doesn't necessarily impart useful
information. Furthermore, we don't need to link to the tests as it's
just as easy to reach it from the Actions tab.
2023-02-21 22:21:35 +01: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
dundargoc
d18f8d5c2d
ci: use multi-config generator on the multi-config test (#22352) 2023-02-21 14:01:49 +01:00
Lewis Russell
2d99830706
refactor(man): add type annotations 2023-02-21 12:19:09 +00:00
zeertzjq
fec1181ecd
test(legacy/prompt_buffer_spec): align script with oldtest more (#22354) 2023-02-21 17:43:53 +08:00
dundargoc
f0ee548137
ci(backport): bump zeebe-io/backport-action from 0 to 1 (#22348)
Notable changes are performance increases for fetching repositories and
simpler workflow file.
2023-02-21 07:43:17 +01:00
Jason Hansen
bdf6d8733e
fix(lsp): wrong format of bufnr and client order in error message (#22336) 2023-02-21 07:24:47 +01:00