| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
vim.deepcopy previously didn't retain metatables in copies
and caused stackoverflow on recursive tables/cycled tables this
fixes these issues
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
04bfd20bb introduced a subtle bug where using 0 as the buffer number in
the diagnostic cache resets the cache for the current buffer. This
happens because we were not checking to see if the _resolved_ buffer
number already existed in the cache; rather, when the __index metamethod
was called we assumed the index did not exist so we set its value to an
empty table. The fix for this is to check `rawget()` for the resolved
buffer number to see if the index already exists.
However, the reason this bug was introduced in the first place was
because we are simply being too clever by allowing a 0 buffer number as
the index which is automatically resolved to a real buffer number.
In the interest of minimizing metatable magic, remove this "feature" by
requiring the buffer number index to always be a valid buffer. This
ensures that the __index metamethod is only ever called for non-existing
buffers (which is what we wanted originally) as well as reduces some of
the cognitive overhead for understanding how the diagnostic cache works.
The tradeoff is that all public API functions must now resolve 0 buffer
numbers to the current buffer number.
|
|
|
|
|
|
|
|
|
| |
Errors were being caused by invalid buffers being kept around in
diagnostic_cache, so add a metatable to diagnostic_cache which attaches
to new buffers in the cache, removing them after they are invalidated.
Closes #16391.
Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
|
|\
| |
| | |
vim-patch:8.2.{3468,3617,3618,3622}: some other CWD related patches
|
| |
| |
| |
| |
| |
| |
| | |
Problem: Problem with :cd when editing file in non-existent directory. (Yee
Cheng Chin)
Solution: Prepend the current directory to get the full path. (closes vim/vim#8903)
https://github.com/vim/vim/commit/c6376c798433bcb9ee38a8664299d11454546950
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current 'clamp_line_numbers' implementation modifies diagnostics in
place, which can have adverse downstream side effects. Before clamping
line numbers, make a copy of the diagnostic. This commit also merges the
'clamp_line_numbers' method into a new 'get_diagnostics' local function
which also implements the more general "get" method. The public
'vim.diagnostic.get()' API now just uses this function (without
clamping). This has the added benefit that other internal API functions
that need to use get() no longer have to go through vim.validate.
Finally, reorganize the source code a bit by grouping all of the data
structures together near the top of the file.
|
|\ |
|
| |
| |
| |
| |
| |
| | |
Rename the `show_header` option in `open_float` to simply `header` and
allow users to specify both the header string as well as the highlight
group.
|
| |
| |
| |
| |
| | |
Extend the 'prefix' option for `open_float` to also provide an optional
highlight group for the prefix string.
|
|/
|
|
|
|
|
| |
Make the bufnr argument have similar semantics across API functions;
namely, a nil value means "all buffers" while 0 means "current buffer".
This increases the flexibility of the API by allowing functions such as
enable() and disable() to apply globally or per-namespace, rather than
only on a specific buffer.
|
|
|
|
| |
The 'prefix' option accepts a function or a string that is used to add a
prefix string to each diagnostic displayed in the floating window.
|
|
|
|
|
|
|
| |
Also fix a few other small bugs regarding saving and restoring extmarks.
In particular, now that the virtual text and underline handlers have
their own dedicated namespaces, they should be responsible for saving
and restoring their own extmarks. Also fix the wrong argument ordering
in the call to `clear_diagnostic_cache` in the `on_detach` callback.
|
|
|
|
|
|
| |
* vim.ui.input is an overridable function that prompts for user input
* take an opts table and the `on_confirm` callback, see `:help vim.ui.input` for more details
* defaults to a wrapper around vim.fn.input(opts)
* switches the built-in client's rename handler to use vim.ui.input by default
|
| |
|
| |
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
1. "unpack" has an unrelated meaning in Lua:
https://www.lua.org/manual/5.1/manual.html#pdf-unpack
2. We already have msgpackparse()/msgpackdump() and
json_encode()/json_decode(), so introducing another name for the same
thing is entropy.
Solution:
- Rename vim.mpack.pack/unpack => vim.mpack.encode/decode
Caveat:
This is incongruent with the `Unpacker` and `Packer` functions.
- It's probably too invasive to rename those.
- They also aren't part of our documented interface.
- This commit is "reversible" in the sense that we can always revert
it and add `vim.mpack.encode/decode` as _aliases_ to
`vim.mpack.pack/unpack`, at any time in the future, if we want
stricter fidelity with upstream libmpack. Meanwhile,
`vim.mpack.encode/decode` is currently the total _documented_
interface of `vim.mpack`, so this change serves the purpose of
consistent naming in the Nvim stdlib.
|
|
|
|
|
|
|
| |
Rather than treating virtual_text, signs, and underline specially,
introduce the concept of generic "handlers", of which those three are
simply the defaults bundled with Nvim. Handlers are called in
`vim.diagnostic.show()` and `vim.diagnostic.hide()` and are used to
handle how diagnostics are displayed.
|
|\
| |
| | |
feat: add vim.str_utf_pos
|
| |
| |
| |
| |
| | |
vim.str_utf_pos returns the codepoints for all utf-8 chars (only, currently)
in a string
|
|/
|
|
| |
this already worked in 0.5 but was not properly documented or tested
|
|\
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
'show_line_diagnostics()' and 'show_position_diagnostics()' are
almost identical; they differ only in the fact that the latter also
accepts a column to form a full position, rather than just a line. This
is not enough to justify two separate interfaces for this common
functionality.
Renaming this to simply 'show_diagnostics()' is one step forward, but
that is also not a good name as the '_diagnostics()' suffix is
redundant. However, we cannot name it simply 'show()' since that
function already exists with entirely different semantics.
Instead, combine these two into a single 'open_float()' function that
handles all of the cases of showing diagnostics in a floating window.
Also add a "float" key to 'vim.diagnostic.config()' to provide global
values of configuration options that can be overridden ephemerally.
This makes the float API consistent with the rest of the diagnostic API.
BREAKING CHANGE
|
|\ \
| | |
| | | |
fix(build): export symbols on Windows
|
| | |
| | |
| | |
| | |
| | |
| | | |
Closes https://github.com/neovim/neovim/issues/15063
Allows using Neovim core functions using LuaJIT FFI on Windows.
|
|\ \ \
| | | |
| | | | |
fix(runtime): don't use regexes inside lua require'mod'
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When using `true` as the value of a configuration option, the option is
configured to use default values. For example, if a user configures
virtual text to include the source globally (using
vim.diagnostic.config) and a specific namespace or producer configures
virtual text with `virt_text = true`, the user's global configuration is
overriden.
Instead, interpret a value of `true` to mean "use existing settings if
defined, otherwise use defaults".
|
| |
| |
| |
| |
| |
| | |
closes https://github.com/neovim/neovim/issues/15261
* normalize uri path to forward slashes on windows
* use a capture group on windows that avoids mistaking drive letters as uri scheme
|
|\ \
| | |
| | | |
Add method call support for more built-ins: vim-patch:8.1.{1336,1952,1961,1984}
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Does not include listener_*() functions.
js_*() functions are N/A.
json_encode() and json_decode() didn't include tests; add some anyway
(to json_functions_spec.lua).
test_lua.vim isn't included yet, so add tests to luaeval_spec.lua.
|
| | | |
|
| | | |
|
| | |
| | |
| | | |
Support the severity_sort option for show_{line,position}_diagnostics.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
updates. fixes #12861
Now mark_adjust() will trigger appropriate buf_updates_send_splice() called by extmark_adjust()
|
| | | |
|
| | | |
|
|\ \ \
| |/ /
|/| | |
feat(lua): add "noempty" param to vim.split()
|