| Commit message (Collapse) | Author | Age |
|
|
| |
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
|
|
|
|
| |
Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: smjonas <jonas.strittmatter@gmx.de>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
| |
|
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
BREAKING CHANGE: When using a Funcref converted from a Lua function as
a method in Vim script, the result of the base expression is now passed
as the first argument instead of being ignored.
vim-patch:8.2.5117: crash when calling a Lua callback from a :def function
Problem: Crash when calling a Lua callback from a :def function. (Bohdan
Makohin)
Solution: Handle FC_CFUNC in call_user_func_check(). (closes vim/vim#10587)
https://github.com/vim/vim/commit/7d149f899d423b7bf2b90d7b11ebe3e560c462b9
|
|/
|
|
| |
fixes #16290
|
|
|
|
|
|
| |
feat(treesitter): use weak tables when possible
Also add the defaulttable function to create a table whose values are created when a key is missing.
|
|
|
| |
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
|
| |
|
| |
|
| |
|
|\
| |
| | |
fix(api): nvim_set_option_value for global-local options
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
global-local window options need to be handled specially. When `win` is
given but `scope` is not, then we want to set the local version of the
option but not the global one, therefore we need to force
`scope='local'`.
Note this does not apply to window-local only options (e.g. 'number')
Example:
nvim_set_option_value('scrolloff', 10, {}) -- global-local window option; set global value
nvim_set_option_value('scrolloff', 20, {win=0}) -- global-local window option; set local value
nvim_set_option_value('number', true, {}) -- local window option
is now equivalent to:
nvim_set_option_value('scrolloff', 10, {})
nvim_set_option_value('scrolloff', 20, {win=0, scope='local'}) -- changed from before
nvim_set_option_value('number', true, {win=0}) -- unchanged from before
Only the global-local option with a `win` provided gets forced to local
scope.
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`nvim_get_option_value` and `nvim_set_option_value` better handle
unsetting local options. For instance, this is currently not possible:
vim.bo.tagfunc = nil
This does not work because 'tagfunc' is marked as "local to buffer" and
does not have a fallback global option. However, using :setlocal *does*
work as expected
:setlocal tagfunc=
`nvim_set_option_value` behaves more like :set and :setlocal (by
design), so using these as the underlying API functions beneath vim.bo
and vim.wo makes those two tables act more like :setlocal. Note that
vim.o *already* uses `nvim_set_option_value` under the hood, so that
vim.o behaves like :set.
|
| |
|
| |
|
|
|
| |
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
|
|
|
|
|
| |
This change adds the necessary plumbing to annotate functions in funcs.c
as being allowed in run in luv fast events.
|
| |
|
| |
|
|
|
|
|
|
| |
`vim.keymap.del` takes an `opts` parameter that lets caller refer to and
delete buffer-local mappings. For some reason the implementation of
`vim.keymap.del` mutates the table that is passed in, setting
`opts.buffer` to `nil`. This is wrong and also undocumented.
|
|
|
|
|
|
| |
vim.tbl_get takes a table with subsequent string arguments (variadic) that
index into the table. If the value pointed to by the set of keys exists,
the function returns the value. If the set of keys does not exist, the
function returns nil.
|
| |
|
| |
|
|
|
|
| |
Screen state is not initialized yet. Print directly to stderr instead.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We have to be sure that the bugs fixed in the previous patches also apply to
nvim_win_call.
Checking v8.1.2124 and v8.2.4026 is especially important as these patches were
only applied to win_execute, but nvim_win_call is also affected by the same
bugs. A lot of win_execute's logic can be shared with nvim_win_call, so factor
it out into a common macro to reduce the possibility of this happening again.
|
|
|
|
|
|
|
|
| |
Problem: ml_get error with :doautoall and Visual area. (Sean Dewar)
Solution: Disable Visual mode while executing autocommands.
https://github.com/vim/vim/commit/cb1956d6f2aece8ad93e19e5d4c7e0b5e405f056
This should also fix #16937 for nvim_buf_call, so test for it.
|
| |
|
|
|
| |
Like vim.notify(), but only displays the notification once.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This introduces two new functions `vim.keymap.set` & `vim.keymap.del`
differences compared to regular set_keymap:
- remap is used as opposite of noremap. By default it's true for <Plug> keymaps and false for others.
- rhs can be lua function.
- mode can be a list of modes.
- replace_keycodes option for lua function expr maps. (Default: true)
- handles buffer specific keymaps
Examples:
```lua
vim.keymap.set('n', 'asdf', function() print("real lua function") end)
vim.keymap.set({'n', 'v'}, '<leader>lr', vim.lsp.buf.references, {buffer=true})
vim.keymap.set('n', '<leader>w', "<cmd>w<cr>", {silent = true, buffer = 5 })
vim.keymap.set('i', '<Tab>', function()
return vim.fn.pumvisible() == 1 and "<C-n>" or "<Tab>"
end, {expr = true})
vim.keymap.set('n', '[%', '<Plug>(MatchitNormalMultiBackward)')
vim.keymap.del('n', 'asdf')
vim.keymap.del({'n', 'i', 'v'}, '<leader>w', {buffer = 5 })
```
|
| |
|
|
|
|
|
|
| |
The Lua modules that make up vim.lua are embedded as raw source files into the
nvim binary. These sources are loaded by the Lua runtime on startuptime. We can
pre-compile these sources into Lua bytecode before embedding them into the
binary, which minimizes the size of the binary and improves startuptime.
|
| |
|
|
|
|
|
| |
vim.deepcopy previously didn't retain metatables in copies
and caused stackoverflow on recursive tables/cycled tables this
fixes these issues
|
| |
|
|
|
|
|
| |
vim.str_utf_{start,end} return the offset from the current position to
the start and end of the current utf-character (nearest codepoint)
respectively.
|
|
|
|
|
| |
vim.str_utf_pos returns the codepoints for all utf-8 chars (only, currently)
in a string
|
|\
| |
| | |
functionaltest: fix running tests under gdbserver
|
| |
| |
| |
| |
| |
| |
| | |
Close the timer started during tests before closing the session. This
fixes the uv_loop_close hangs happening in the functional tests.
Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh2702@gmail.com>
|
| |
| |
| |
| |
| |
| | |
vim.bo can target a specific buffer by indexing with a number, e.g:
`vim.bo[2].filetype` can get/set the filetype for buffer 2. This change
replicates that behaviour for the variable namespace.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes #15147 and fixes #15497. Also sketch "subdir" caching. Currently
this only caches whether an rtp entry has a "lua/" subdir but we could
consider cache other subdirs potentially or even "lua/mybigplugin/"
possibly.
Note: the async_leftpad test doesn't actually fail on master, at least
not deterministically (even when disabling the fast_breakcheck
throttling). It's still useful as a regression test for further changes
and included as such.
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `split()` VimL function trims empty items from the returned list by
default, so that, e.g.
split("\nhello\nworld\n\n", "\n")
returns
["hello", "world"]
The Lua implementation of vim.split does not do this. For example,
vim.split("\nhello\nworld\n\n", "\n")
returns
{'', 'hello', 'world', '', ''}
Add an optional parameter to the vim.split function that, when true,
trims these empty elements from the front and back of the returned
table. This is only possible for vim.split and not vim.gsplit; because
vim.gsplit is an iterator, there is no way for it to know if the current
item is the last non-empty item.
Note that in order to preserve backward compatibility, the parameter for
the Lua vim.split function is `trimempty`, while the VimL function uses
`keepempty` (i.e. they are opposites). This means there is a disconnect
between these two functions that may surprise users.
|
|
|
|
|
|
|
| |
Problem: Incorrect error messages for functions that now take a Blob
argument.
Solution: Adjust the error messages. (Dominique Pelle, closes vim/vim#3846)
https://github.com/vim/vim/commit/0d17f0d1c09fa6db306336695ba646c21ea24909
|
|
|
|
|
|
|
|
|
| |
Analogous to nodejs's `on('data', …)` interface, here on_key is the "add
listener" interface.
ref 3ccdbc570d85 #12536
BREAKING_CHANGE: vim.register_keystroke_callback() is now an error.
|