| Commit message (Collapse) | Author | Age |
| |
|
| |
|
| |
|
|
|
|
|
|
| |
`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.
|
|
|
|
|
| |
Use nvim_exec_autocmds to issue the DiagnosticChanged autocommand,
rather than nvim_buf_call, which has some side effects when drawing
statuslines.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|\
| |
| | |
feat: __tostring lua errors if possible before showing in messages
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Screen state is not initialized yet. Print directly to stderr instead.
|
| | |
|
| | |
|
|\ \
| | |
| | | |
fix(api): convert blob to NUL-terminated API string
|
| |/
| |
| |
| |
| | |
Looks like I did an oopsie; although API strings carry a size field, they should
still be usable as C-strings! (even though they may contain embedded NULs)
|
| | |
|
|/ |
|
| |
|
|
|
| |
Fixes #17207
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
| |
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
Closes https://github.com/neovim/neovim/issues/13647
This allows customizing the priority of the highlights.
* Add default priority of 50
* Use priority of 200 for highlight on yank
* use priority of 40 for highlight references (LSP)
|
|
|
|
|
|
|
| |
This allows patterns like
["~/.config/foo"] = "fooscript"
to work.
|
| |
|
|
|
|
|
| |
This is a much better solution than #16942 as it doesn't require copying
every new change from test_filetype.vim into filetype_spec.lua (which is
much more maintainable).
|
|
|
|
|
|
|
| |
(#16953)
Problem: Git and gitcommit file types not properly recognized.
Solution: Adjust filetype detection. (Tim Pope, closes vim/vim#9477)
https://github.com/vim/vim/commit/c689f8c3d98fffe7e13730e198ce120934528f9c
|
| |
|
|
|
| |
Like vim.notify(), but only displays the notification once.
|
|\
| |
| | |
feat(lua): add support for lua keymaps
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 })
```
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Because filetype.lua is gated behind an opt-in variable, it's not tested
during the "standard" test_filetype.vim test. So port the test into
filetype_spec where we enable the opt-in variable.
This means runtime Vim patches will need to update test_filetype in two
places. This can eventually be removed if/when filetype.lua is made
opt-out rather than opt-in.
|
| |
| |
| |
| |
| |
| |
| | |
Filetype detection runs on BufRead and BufNewFile autocommands, both of
which can fire without an underlying buffer, so it's incorrect to use
<abuf> to determine the file path. Instead, match on <afile> and assume
that the buffer we're operating on is the current buffer. This is the
same assumption that filetype.vim makes, so it should be safe.
|
|/ |
|
|
|
|
| |
Adds a new vim.filetype module that provides support for filetype detection in
Lua.
|
| |
|
|
|
|
|
| |
Solves #13651
Co-authored-by: Gregory Anders <greg@gpanders.com>
|
|
|
|
|
|
| |
Function arguments that expect a list should explicitly use tbl_islist
rather than just checking for a table. This helps catch some simple
errors where a single table item is passed as an argument, which passes
validation (since it's a table), but causes other errors later on.
|
| |
|
|
|
|
|
| |
Add support for adding and removing custom user commands with the Nvim
API.
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The overwhelming majority of use cases for `open_float` are to view
diagnostics from the current buffer in a floating window. Thus, most use
cases will just `0` or `nil` as the first argument, which makes the
argument effectively useless and wasteful.
In the cause of optimizing for the primary use case, make the `bufnr`
parameter an optional parameter in the options table. This still allows
using an alternative buffer for those that wish to do so, but makes the
"primary" use case much easier.
The old signature is preserved for backward compatibility, though it can
likely be fully deprecated at some point.
|
|
|
|
| |
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
|
| |
|
|
|
|
|
| |
Closes #16453
Co-authored-by: Cédric Barreteau <cbarrete@users.noreply.github.com>
|