Commit Graph

1201 Commits

Author SHA1 Message Date
Matthew Gramigna
523b1943c3
vim-patch:9.0.0897: Clinical Quality Language files are not recognized (#21094)
Problem:    Clinical Quality Language files are not recognized.
Solution:   Add the "*.cql" pattern. (Matthew Gramigna, closes vim/vim#11452)

12babe45a3

Co-authored-by: mgramigna <mgramigna@mitre.org>
2022-11-18 00:39:31 +01:00
Gregory Anders
f1922e78a1 feat: add vim.secure.read()
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.
2022-11-17 08:23:41 -07:00
Max
e15f61b1bd fix(lua): make vim.deepcopy work with vim.NIL
style: changed double quotes to single quotes

feat: add tests

fix tests
2022-11-14 21:14:27 +01:00
Steven Arcangeli
b3f781ba91
fix: vim.ui.input always calls callback #21006
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.
2022-11-12 06:57:35 -08:00
Lewis Russell
07eb4263ca feat(spell): support nospell in treesitter queries 2022-11-12 10:19:03 +00:00
Justin M. Keyes
4d2373f5f6
feat(checkhealth): use "help" syntax, avoid tabpage #20879
- 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.
2022-11-11 18:33:31 -08:00
euclidianAce
0faf007a23
fix(man.lua): use env command (#21007)
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.
2022-11-09 23:26:02 +00:00
Jongwook Choi
59ff4691f6
fix(vim.ui.input): return empty string when inputs nothing (#20883)
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.
2022-11-08 08:15:15 +08:00
Christian Clason
050b0e30b9
vim-patch:9.0.0843: VHS tape files are not recognized (#20995)
Problem:    VHS tape files are not recognized.
Solution:   Add a filetype pattern. (Carlos Alexandro Becker, closes vim/vim#11452)

1756f4b218

Co-authored-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-07 22:28:28 +01:00
zeertzjq
850d7146fc
fix(paste): feed keys as typed in cmdline mode (#20959) 2022-11-06 12:43:05 +08:00
Kevin Hwang
cc5b7368d6
fix(man.lua): set modifiable before writing page (#20914) 2022-11-03 09:13:29 +08:00
Justin M. Keyes
cc7c378bf3 feat(checkhealth): check runtime ($VIMRUNTIME)
Move man/health.lua into the "runtime" check.

fix #20696
2022-10-30 16:23:58 +01:00
Justin M. Keyes
3213bc36c5 refactor(checkhealth): convert "nvim" check to Lua 2022-10-30 15:50:59 +01:00
Justin M. Keyes
c7a88a470f feat(checkhealth): improve treesitter report 2022-10-30 15:50:59 +01:00
lvimuser
e0dff29adc
fix(lsp/window_showDocument): correctly handle external resources #20867
- since cmd is a list, it runs directly ('no shell') and we shouldn't
  escape.
- typo: shellerror -> shell_error
2022-10-30 02:35:22 -07:00
Martin Kunz
356244d50b
fix(docs): nil as viable argument for goto_prev (#20852)
Added `nil` as a possible option to `vim.diagnostics.goto_prev` in the
docs
2022-10-28 17:13:27 -06:00
NAKAI Tsuyoshi
4573cfa3ad
fix(lua): pesc, tbl_islist result types #20751
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>
2022-10-24 05:53:53 -07:00
Christian Clason
8371907203
vim-patch:9.0.0814: aws config files are not recognized (#20769)
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)
436e5d395f
2022-10-21 16:36:43 +02:00
Christian Clason
e554f5c545
fix(filetype): don't pass empty string to detect (#20766)
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
2022-10-21 14:04:53 +02:00
Christian Clason
45ae5c6dc5
vim-patch:9.0.0808: jsonnet filetype detection has a typo (#20753)
Problem:    jsonnet filetype detection has a typo.
Solution:   Change "libjsonnet" to "libsonnet". (Maxime Brunet, closes vim/vim#11412)
6c8bc37a10
2022-10-20 22:49:22 +02:00
ObserverOfTime
fad558b6af
vim-patch:9.0.0798: clang format configuration files are not recognized (#20741)
Problem:    Clang format configuration files are not recognized.
Solution:   Use yaml for Clang format configuration files. (Marwin Glaser,
            closes vim/vim#11398)
3c708c4390
2022-10-19 11:08:01 -06:00
Christian Clason
228a04070e
vim-patch:9.0.0779: lsl and lm3 file extensions are not recognized (#20704)
Problem:    lsl and lm3 file extensions are not recognized.
Solution:   Add *.lsl and *.lm3 patterns. (Doug Kearns, closes vim/vim#11384)
4ac8e7948c
2022-10-18 20:05:50 +02:00
Christian Clason
e427313545
vim-patch:9.0.0782: OpenVPN files are not recognized (#20702)
Problem:    OpenVPN files are not recognized.
Solution:   Add patterns for OpenVPN files. (closes vim/vim#11391)
4bf67ec52e
2022-10-17 18:36:10 +02:00
Mahmoud Al-Qudsi
39911d76be
fix(man): handle absolute paths as :Man targets (#20624)
* 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.
2022-10-17 10:37:44 +01:00
Christian Clason
042eb74ff1
feat(runtime)!: remove filetype.vim (#20428)
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.
2022-10-17 08:52:40 +02:00
Jonas Strittmatter
d44f088834
vim-patch:9.0.0771: cannot always tell the difference beween tex and … (#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)
bd053f894b
2022-10-17 08:18:57 +02:00
David Hotham
8f31a730c0
fix(lsp): reporting bogus capabilities in CodeActionKind #20678
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
2022-10-16 15:24:39 -07:00
Christian Clason
e26b48bde6
vim-patch:9.0.0752: Rprofile files are not recognized (#20658)
Problem:    Rprofile files are not recognized.
Solution:   Recognize Rprofile files as "r". (closes vim/vim#11369)
7e120ffccb
2022-10-15 10:12:25 +02:00
Justin M. Keyes
e5cb3104d0
docs: fix/remove invalid URLs #20647 2022-10-14 08:01:13 -07:00
Daniel Zhang
81986a7349
fix(lua): on_yank error with blockwise multibyte region #20162
Prevent out of range error when calling `str_byteindex`.
Use `vim.str_byteindex(bufline, #bufline)` to cacluate utf length of `bufline`.
fix #20161
2022-10-14 02:12:46 -07:00
Lewis Russell
288208257c feat(cscope)!: remove 2022-10-13 16:37:23 +01:00
Christian Clason
4f305fba14
vim-patch:9.0.0731: clang-tidy configuration files are not recognized (#20620)
Problem:    clang-tidy configuration files are not recognized.
Solution:   Recognize clang-tidy files as yaml. (closes vim/vim#11350)
af40f9af33
2022-10-12 15:23:42 +02:00
Lewis Russell
b126b11840 fix(man): support MacOS 13
MacOS 13 has changed its version of `man` to an version that doesn't
properly support `man -w` (without arguments). In order to workaround
this we simply fallback to $MANPATH.

Fixes #20579
2022-10-11 15:38:15 +01:00
Lewis Russell
cba05c541d
refactor(man): pass env directly to spawn() (#20591) 2022-10-11 13:25:42 +01:00
Christian Clason
8781213f00
vim-patch:9.0.0711: SubStation Alpha files are not recognized (#20577)
Problem:    SubStation Alpha files are not recognized.
Solution:   Add patterns for SubStation Alpha files. (closes vim/vim#11332)
084f2620ec
2022-10-10 17:51:31 +02:00
Lewis Russell
4ccc57fd7a feat(man): add health check
Fixes #20432
2022-10-10 15:58:44 +01:00
Justin M. Keyes
a7a83bc4c2 fix(docs-html): update parser
- Improve generated HTML by updating parser which includes fixes for
  single "'" and single "|":
  https://github.com/neovim/tree-sitter-vimdoc/pull/31
- Updated parser also fixes the conceal issue for "help" highlight
  queries https://github.com/neovim/tree-sitter-vimdoc/issues/23 by
  NOT including whitespace in nodes.
  - But this means we need to restore the getws() function which scrapes
    leading whitespace from the original input (buffer).
2022-10-10 01:05:18 +02:00
Justin M. Keyes
09dffb9db7
docs: various #12823
- increase python line-length limit from 88 => 100.
- gen_help_html: fix bug in "tag" case (tbl_count => tbl_contains)

ref #15632
fix #18215
fix #18479
fix #20527
fix #20532

Co-authored-by: Ben Weedon <ben@weedon.email>
2022-10-09 05:21:52 -07:00
Folke Lemaitre
8c2226fc30
fix(lua): properly configure luacheck and remove local vim = ... lines (#20551) 2022-10-09 12:40:56 +02:00
ObserverOfTime
b05e10ef72
vim-patch:9.0.0692: PoE filter files are not recognized (#20542)
Problem:    PoE filter files are not recognized.
Solution:   Add a pattern to detect PoE filter files. (closes vim/vim#11305)
b7f52f5659
2022-10-08 17:46:31 +02:00
lvimuser
0773a9ee3a
feat(lsp): support window/showDocument (#19977) 2022-10-08 10:22:25 +02:00
Folke Lemaitre
1da7b4eb69 feat: added support for specifying types for lua2dox 2022-10-06 15:42:21 +01:00
Folke Lemaitre
24a1c7f556 feat: added support for optional params to lua2dox 2022-10-06 15:38:28 +01:00
Folke Lemaitre
c8d1b9a2d6 docs: added proper annotations to functions in shared.lua 2022-10-06 15:38:27 +01:00
Elizabeth Paź
548a4e2587 docs(docstrings): fix runtime type annotations 2022-10-05 15:25:03 +02:00
August Masquelier
b075f49d92
feat(lsp): add bufnr option to lsp.start (#20473) 2022-10-04 20:44:19 +02:00
Raphael
a5e347ce1d
refactor(diagnostic): remove deprecated function (#20423) 2022-10-01 09:36:11 -06:00
Mathias Fußenegger
e54541f7f9
refactor(lsp): remove deprecated lsp functions (#20421) 2022-10-01 11:35:36 +02:00
dundargoc
df646572c5
docs: fix typos (#20394)
Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: smjonas <jonas.strittmatter@gmx.de>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-30 09:53:52 +02:00
Jonas Strittmatter
33dd917d7f
fix(filetype): add missing return to changelog detection function (#20403) 2022-09-29 16:26:19 +02:00