| Commit message (Collapse) | Author | Age |
... | |
| |/
| |
| |
| | |
Avoid using vim.env and vim.fn in vim.fs functions so that
they can be used in "fast" contexts.
|
| |
| |
| |
| |
| | |
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Introduce vim.secure.trust() to programmatically manage the trust
database. Use this function in a new :trust ex command which can
be used as a simple frontend.
Resolves: https://github.com/neovim/neovim/issues/21092
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: ii14 <ii14@users.noreply.github.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Eclipse preference files are not recognized.
Solution: Add a pattern to use "jproperties" for Eclipse preference files.
(closes vim/vim#11618)
https://github.com/vim/vim/commit/f3f198b6349fe252b72975701e2f17d932b19c70
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#21174)
* vim-patch:9.0.0935: when using dash it may not be recognize as filetype "sh"
Problem: When using dash it may not be recognize as filetype "sh".
Solution: Add checks for "dash". (Eisuke Kawashima,closes vim/vim#11600)
https://github.com/vim/vim/commit/24482fbfd599d2273c48951df7d00d62f3e66c85
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Oblivion files are not recognized.
Solution: Recognize Oblivion files and alike as "obse". (closes vim/vim#11540)
https://github.com/vim/vim/commit/ecfd511e8d802068434735dda00db6b783df6922
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#21183)
Problem: Workflow Description Language files are not recognized.
Solution: Add a pattern for the "wdl" filetype. (Matt Dunford,
closes vim/vim#11611)
https://github.com/vim/vim/commit/f60bdc3417a56a1f69e001a7ec210b92d5b0f2e1
Co-authored-by: Matt Dunford <zenmatic@gmail.com>
|
| |
| |
| |
| | |
Co-Authored-By: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Co-Authored-By: zeertzjq <zeertzjq@outlook.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Mermaid files are not recognized.
Solution: Add patterns for Mermaid. (Crag MacEachern)
https://github.com/vim/vim/commit/364438d1e817d1d76003695f9ab533df35f8948a
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| | |
Some functions didn't include the `nil` case in the return type
annotation. This corrects those and also adds a Diagnostic class
definition for the diagnostic.get return type
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
This introduces a `suffix` option to the `virt_text` config in
`vim.diagnostic.config()`. The suffix can either be a string which is appended
to the diagnostic message or a function returning such. The function receives a
`diagnostic` argument, which is the diagnostic table of the last diagnostic (the
one whose message is rendered as virt text).
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Closes #18687
This introduces a `suffix` option to `vim.diagnostic.open_float()` (and
consequently `vim.diagnostic.config()`) that appends some text to each
diagnostic in the float.
It accepts the same types as `prefix`. For multiline diagnostics, the suffix is
only appended to the last line. By default, the suffix will render the
diagnostic error code, if any.
|
| |
| |
| |
| |
| | |
* fix(diagnostic): use api variable and improve validate
* fix: fix test case
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Language servers can take some time to respond to the
`textDocument/hover` and `textDocument/signatureHelp` messages. During
that time, the user could have already moved to another buffer. The
popup was always shown in the current buffer, which could be a different
one than the buffer for which the request was sent.
This was particularly annoying when moving to a buffer with a `BufLeave`
autocmd, as that autocmd was triggered when the hover popup was shown
for the original buffer.
Ignoring the response from these 2 messages if they are for a buffer
that is not the current one leads to less noise. The popup will only be
shown for the buffer for which it was requested.
A more robust solution could involve cancelling the hover/signatureHelp
request if the buffer changes so the language server can free its
resources. It could be implemented in the future.
|
| |
| |
| |
| | |
To illustrate a use-case this also changes `window/showMessageRequest`
to use `vim.ui.select`
|
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Clinical Quality Language files are not recognized.
Solution: Add the "*.cql" pattern. (Matthew Gramigna, closes vim/vim#11452)
https://github.com/vim/vim/commit/12babe45a389cd1ea8befd5b06239e877b4abbba
Co-authored-by: mgramigna <mgramigna@mitre.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This function accepts a path to a file and prompts the user if the file
is trusted. If the user confirms that the file is trusted, the contents
of the file are returned. The user's decision is stored in a trust
database at $XDG_STATE_HOME/nvim/trust. When this function is invoked
with a path that is already marked as trusted in the trust database, the
user is not prompted for a response.
|
| |
| |
| |
| |
| |
| |
| |
| | |
style: changed double quotes to single quotes
feat: add tests
fix tests
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Followup to #20883
Related: #18144
This patch changes the behavior of the default `vim.ui.input` when the user
aborts with `<C-c>`. Currently, it produces an error message + stack and causes
`on_confirm` to not be called. With this patch, `<C-c>` will cause `on_confirm`
to be called with `nil`, the same behavior as when the user aborts with `<Esc>`.
I can think of three good reasons why the behavior should be this way:
1. Easier for the user to understand** It's not intuitive for there to be two
ways to abort an input dialog that have _different_ outcomes. As a user,
I would expect any action that cancels the input to leave me in the same
state. As a plugin author, I see no value in having two possible outcomes for
aborting the input. I have to handle both cases, but I can't think of
a situation where I would want to treat one differently than the other.
2. Provides an API that can be overridden by other implementations** The current
contract of "throw an error upon `<C-c>`" cannot be replicated by async
implementations of `vim.ui.input`. If the callsite wants to handle the case
of the user hitting `<C-c>` they need to use `pcall(vim.ui.input, ...)`,
however an async implementation will instantly return and so there will be no
way for it to produce the same error-throwing behavior when the user inputs
`<C-c>`. This makes it impossible to be fully API-compatible with the
built-in `vim.ui.input`.
3. Provides a useful guarantee to the callsite** As a plugin author, I want the
guarantee that `on_confirm` will _always_ be called (only catastrophic errors
should prevent this). If I am in the middle of some async thread of logic,
I need some way to resume that logic after handing off control to
`vim.ui.input`. The only way to handle the `<C-c>` case is with `pcall`,
which as already mentioned, breaks down if you're using an alternative
implementation.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- If Nvim was just started, don't create a new tab.
- Name the buffer "health://".
- Use "help" syntax instead of "markdown". It fits better, and
eliminates various workarounds.
- Simplfy formatting, avoid visual noise.
- Don't print a "INFO" status, it is noisy.
- Drop the ":" after statuses, they are already UPPERCASE and highlighted.
|
| |
| |
| |
| |
| |
| |
| | |
Previously man.lua would use the `env` field in the parameters of
`vim.loop.spawn` to override things like MANPAGER. This caused issues on
NixOS since `spawn` will _override_ the environment rather than _append_
to it (and NixOS relies on a heavily modified environment). Using the
`env` command to append to the environment solves this issue.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
fix(vim.ui.input): return empty string when inputs nothing
The previous behavior of `vim.ui.input()` when typing <CR> with
no text input (with an intention of having the empty string as input)
was to execute `on_confirm(nil)`, conflicting with its documentation.
Inputting an empty string should now correctly execute `on_confirm('')`.
This should be clearly distinguished from cancelling or aborting the
input UI, in which case `on_confirm(nil)` is executed as before.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: VHS tape files are not recognized.
Solution: Add a filetype pattern. (Carlos Alexandro Becker, closes vim/vim#11452)
https://github.com/vim/vim/commit/1756f4b21837e8596241ecd668f4abbbab4bc7e5
Co-authored-by: Carlos A Becker <caarlos0@users.noreply.github.com>
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
Move man/health.lua into the "runtime" check.
fix #20696
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
- since cmd is a list, it runs directly ('no shell') and we shouldn't
escape.
- typo: shellerror -> shell_error
|
| |
| |
| |
| | |
Added `nil` as a possible option to `vim.diagnostics.goto_prev` in the
docs
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem:
- pesc() returns multiple results, it should return a single result.
- tbl_islist() returns non-boolean in some branches.
- Docstring: @generic must be declared first
Solution:
Constrain docstring annotations.
Fix return types.
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
vim-patch:436e5d395fd6 (since upstream tagged the wrong commit)
Problem: Aws config files are not recognized.
Solution: Use "confini" for aws config files. (Justin M. Keyes,
closes vim/vim#11416)
https://github.com/vim/vim/commit/436e5d395fd629c8d33b5cf7b373aad007f16851
|
| |
| |
| |
| |
| | |
Problem: `*.db` files use empty string as default filetype, which is
inconsistent with the rest of the code which uses `nil` instead.
Solution: don't pass a default empty string
|
| |
| |
| |
| |
| | |
Problem: jsonnet filetype detection has a typo.
Solution: Change "libjsonnet" to "libsonnet". (Maxime Brunet, closes vim/vim#11412)
https://github.com/vim/vim/commit/6c8bc37a1083d17447156592f6f52da2d40b4855
|
| |
| |
| |
| |
| |
| | |
Problem: Clang format configuration files are not recognized.
Solution: Use yaml for Clang format configuration files. (Marwin Glaser,
closes vim/vim#11398)
https://github.com/vim/vim/commit/3c708c43908ba44f075bbaa7daf584c6b46d9723
|
| |
| |
| |
| |
| | |
Problem: lsl and lm3 file extensions are not recognized.
Solution: Add *.lsl and *.lm3 patterns. (Doug Kearns, closes vim/vim#11384)
https://github.com/vim/vim/commit/4ac8e7948cb3e07bc4598ede8b274891d14dfa7c
|
| |
| |
| |
| |
| | |
Problem: OpenVPN files are not recognized.
Solution: Add patterns for OpenVPN files. (closes vim/vim#11391)
https://github.com/vim/vim/commit/4bf67ec52e938a3edaa4f452adab42a57505f940
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* fix(man): handle absolute paths as :Man targets
Previously, attempting to provide `:Man` with an absolute path as the name would
cause neovim to return the following error:
```
Error detected while processing command line:
/usr/local/share/nvim/runtime/lua/man.lua:690: /usr/local/share/nvim/runtime/lua/man.lua:683: Vim:E426: tag not found: nil(nil)
Press ENTER or type command to continue
```
..because it would try to validate the existence of a man page for the provided
name by executing `man -w /some/path` which (on at least some Linux machines
[0]) returns `/some/path` instead of the path to the nroff files that would be
formatted to satisfy the man(1) lookup.
While man pages are not normally named after absolute paths, users shouldn't be
blamed for trying. Given such a name/path, neovim would **not** complain that
the path didn't have a corresponding man file but would error out when trying
to call the tag function for the null-propagated name-and-section `nil(nil)`.
(The same underlying error existed before this function was ported to lua, but
did not exhibit the lua-specific `nil(nil)` name; instead a tag lookup for `()`
would fail and error out.)
With this patch, we detect the case where `man -w ...` returns the same value as
the provided name to not only prevent invoking the tag function for a
non-existent/malformed name+sect but also to properly report the non-existence
of a man page for the provided lookup (the absolute path).
While man(1) can be used to directly read an nroff-formatted document via `man
/path/to/nroff.doc`, `:Man /path/to/nroff.doc` never supported this behavior so
no functionality is lost in case the provided path _was_ an nroff file.
[0]: `man -w /absolute/path` returning `/absolute/path` observed on an Ubuntu
18.04 installation.
* test: add regression test for #20624
Add a functional test to `man_spec.lua` to check for a regression for #20624 by
first obtaining an absolute path to a random file and materializing it to disk,
then attempting to query `:Man` for an entry by that same name/path.
The test passes if nvim correctly reports that there is no man page
correspending to the provided name/path and fails if any other error (or no
error) is shown.
|
| |
| |
| |
| |
| |
| | |
Made obsolete by now graduated `filetype.lua` (enabled by default).
Note that changes or additions to the filetype detection still need to
be made through a PR to vim/vim as we port the _logic_ as well as tests.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#20687)
vim-patch:9.0.0771: cannot always tell the difference beween tex and rexx files
Problem: Cannot always tell the difference beween tex and rexx files.
Solution: Recognize tex by a leading backslash. (Martin Tournoij,
closes vim/vim#11380)
https://github.com/vim/vim/commit/bd053f894b0d7652928201faa68c53d1ce2acdc5
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem:
LSP client provides bogus capabilities in CodeActionKind.
LSP logs show this in the "initialize" message:
codeActionKind = { valueSet = { "Empty", "QuickFix",
"Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite",
"Source", "SourceOrganizeImports", "", "quickfix", "refactor",
"refactor.extract", "refactor.inline", "refactor.rewrite", "source",
"source.organizeImports" }
Solution:
Only the values from the CodeActionKind table should be presented, not also the
keys.
fix #20657
|
| |
| |
| |
| |
| | |
Problem: Rprofile files are not recognized.
Solution: Recognize Rprofile files as "r". (closes vim/vim#11369)
https://github.com/vim/vim/commit/7e120ffccbf81ae8acac28f11fbd5eab79a1630d
|
| | |
|
| |
| |
| |
| |
| | |
Prevent out of range error when calling `str_byteindex`.
Use `vim.str_byteindex(bufline, #bufline)` to cacluate utf length of `bufline`.
fix #20161
|
| | |
|
| |
| |
| |
| |
| | |
Problem: clang-tidy configuration files are not recognized.
Solution: Recognize clang-tidy files as yaml. (closes vim/vim#11350)
https://github.com/vim/vim/commit/af40f9af335e0c8b167eac31ceace45b6a2e0565
|