| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement the LanguageTree structure to enable language injection.
This is done be removing the old Parser metatable and replacing by the
new structure, with the same API (almost).
Some noticeable differences :
- `parser:parse()` now returns a table of trees
- There is no incremental parsing for child (injected) languages
Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>
|
| |
|
|
|
|
|
| |
Weirdl this test is failing, but can't reproduce locally, this is an
unnecessary blocker for this PR.
|
| |
|
|
|
|
| |
¡NO HAY BANDA!
|
| |
|
|\
| |
| | |
vim.validate(): include stacktrace in message
|
| |
| |
| |
| |
| |
| |
| | |
- The previous commit lost information in the tests. Instead, add some
more "normalization" substitutions in pcall_err(), so that the general
shape of the stacktrace is included in the asserted text.
- Eliminate contains(), it is redundant with matches()
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Also allow to get parser ranges.
This will be useful for language injection, allowing us to tweak the
parser's ranges on the fly.
Update runtime/lua/vim/treesitter.lua
Co-authored-by: Paul Burlumi <paul@burlumi.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Runtime queries just work like ftplugins, that is:
- Queries in the `after` directory are sourced _after_ the "base" query
- Otherwise, the last define query takes precedence.
Queries can be found in the `queries` directory.
Update runtime/lua/vim/treesitter/query.lua
Co-authored-by: Paul Burlumi <paul@burlumi.com>
|
| | |
|
|/
|
|
|
|
|
|
|
| |
* lua: vim.wait allows control of fast events
* fixup: remove requirement of function for easier waiting
* fixup: lint
* fixup: bfredl comments
|
| |
|
| |
|
|
|
|
| |
Fixes #12718.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
On empty buffers, when editing the first line, the line is buffered, causing offset to be < 0. While the buffer is not actually empty, the buffered line has not been flushed (and should not be) yet, so the call is valid but an edge case.
|
|
|
|
|
| |
This fixes an error when fo=ro, when hitting <CR> to insert a new
comment line.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
a bit of test cleanup
ärrår
feeel
SPLIT
fix: sned correct updates on <CR>
|
| |
|
| |
|
|
|
|
|
|
| |
This implements byte-resolution updates of buffer changes.
Note: there is no promise that the buffer state is valid inside
the callback!
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
treesitter: avoid escaping complete query strings
|
| |
| |
| |
| |
| | |
Escape "\\" only for `vim-match?` not for `match?`
Fixes #12595
|
| | |
|
|/ |
|
|
|
|
|
| |
This caused segfaults when calling win_findbuf in an `on_detach`
callback, when the callback was triggered when closing the last window
containing the buffer.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* feat: Add vim.register_keystroke_callback
* fixup: Forgot to remove mention of old option
* fixup: Answer jamessan comments
* fixup: Answer norcalli comments
* fixup: portability
* Update runtime/doc/lua.txt
Co-authored-by: Ashkan Kiani <ashkan.k.kiani@gmail.com>
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Test this using treesitter highlighting, which is based on this
old_byte_size.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Can be reproduced with a script like this:
-- in some lua file
vim.fn.timer_start(10, function() error("uh....") end)
-- will cause neovim to crash with the following error.
PANIC: unprotected error in call to Lua API
(nlua_CFunction_func_call failed.)
After this, it will instead print the error message
from the top of the stack, like so.
tmp/error_nvim.lua:10: uh...
Also added an example test. Previously this test
caused the embedded nvim to panic.
|
|
|
|
|
|
|
|
|
|
|
|
| |
vim-patch:8.2.1054: not so easy to pass a lua function to Vim
vim-patch:8.2.1084: Lua: registering function has useless code
I think I have also opened up the possibility for people to use these
callbacks elsewhere, since I've added a new struct that we should be
able to use.
Also, this should allow us to determine what the state of a list is in
Lua or a dictionary in Lua, since we now can track the luaref as we go.
|
| |
|
| |
|