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
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.
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>
Problem: flatten() does not use maxdepth correctly.
Solution: Use a recursive implementation. (closesvim/vim#10020)
acf7d73a7f
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: flatten() always changes the list type.
Solution: Disallow using flatten() and add flattennew().
3b69006973
Co-authored-by: Bram Moolenaar <Bram@vim.org>
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>
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.
* 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.
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.
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.
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.
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.