Problem: Quitting source buffer for ```:InspectTree``` command raises
```E855``` when source buffer and tree views are the only open buffers.
Solution: Add ```QuitPre``` event to autocmd handling closing/hiding the
source buffer to close all open tree views. This allows nvim to quit
when source and tree buffers are the only open windows.
These changes enable tar.vim to keep permissions of files that were
edited intact instead of replacing them with the default permissions.
The major change for this is switching from "tar -OPxf", which reads out
the contents of the selected file from an tar archive to stdout to
"tar -pPxf" which extracts the selected file to the current directory
with permissions intact
This requirs the temporary directory to be created earlier.
closes: vim/vim#7379129a8446d2
Co-authored-by: Lennart00 <73488709+Lennart00@users.noreply.github.com>
This changes the type for the sorted pattern table from
`vim.filetype.mapping[]` to `vim.filetype.mapping.sorted[]`
E.g. instead of:
```lua
{
{ ['/debian/changelog$'] = {'debchangelog', { parent = '/debian/' } },
{ ['%.git/'] = { detect.git , { parent = 'git/', priority = -1 } },
}
```
It is now:
```lua
{
{ '/debian/, '/debian/changelog$', 'debchangelog' },
{ 'git/' , '%.git/' , detect.git , -1 },
}
```
Overall this should roughly cut the amount of tables used by 3, and
replaces lots of hash indexes with array indexes.
So let's revert "runtime(tex): add Number highlighting to syntax file"
This (partly) reverts commits 8e6b5034f32049fd0 and 6065755a39d838aab
fixes: vim/vim#16030622f6f5b9a
Co-authored-by: Christian Brabandt <cb@256bit.org>
Fix command name termination, match bang, and allow a line-continued
argument.
closes: vim/vim#15358bbe5252c2c
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
- Enable folding of class, enum and interface declarations.
- Highlight constructor names with the Function highlight group, like
other special methods.
- Mark function definitions using special method names as errors.
- Highlight :type arguments.
fixes: vim/vim#14393#issuecomment-2042796198.
closes: vim/vim#13810818c641b6f
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Currently, the overriding object method definitions are
matched as vimFunctionError (:help builtin-object-methods,
v9.1.0148).
For example:
------------------------------------------------------------
vim9script
class Test
def string(): string
return "Test"
enddef
endclass
echo string(Test.new()) == Test.new().string()
------------------------------------------------------------
Instead, let's introduce a new syntax group vimMethodName
and make these methods its members. In order to emphasise
the link between the overriding methods and the overridden
functions for highlighting, vimMethodName is linked by
default to vimFuncName.
80aabaab66
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
With the arrival of Vim9 classes, the syntax must allow for
_new_ constructors; multiple constructor definitions are
supported for a class, provided distinct suffix-names are
used. Currently, the defined constructors match either
vimCommand or vimFunctionError (for any newBar).
For example:
------------------------------------------------------------
vim9script
class Foo
def new()
enddef
def newBar()
enddef
endclass
------------------------------------------------------------
Since every constructor is required to bear a lower-cased
_new_ prefix name, it should suffice to distinguish them
from functions, and so there are no new highlight or syntax
groups introduced.
dfcef890cb
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
Problem: Ext_messages chunks only contain the highlight attr id, which
is not very useful for vim.ui_attach() consumers.
Solotion: Add highlight group id to message chunks, which can easily be
used to highlight text in the TUI through nvim_buf_set_extmark():
hl_group = synIDattr(id, "name").
Properly escape the values for makeprg according to the :set rules
closes: vim/vim#160140f60fbf679
Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
Problem: filetype: leo files are not recognized
Solution: detect '*.leo' files as leo filetype, include
a filetype plugin (Riley Bruins)
References:
https://github.com/ProvableHQ/leocloses: vim/vim#1598893f65a4ab8
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
Set the "matchparen_disable_cursor_hl" config variable to disable
highlighting the cursor with the MatchParen highlighting group.
closes: vim/vim#1598459834ba6df
Co-authored-by: Matteo Landi <matteo@matteolandi.net>
- Move mantic to unsupported
- Reorder names to maintain alphabetic order
- Bump date to submit upstream
closes: vim/vim#159919dadfe7a52
Co-authored-by: James McCoy <jamessan@jamessan.com>
Problem:
There are three different ways of marking an option as hidden, `enable_if
= false`, `hidden = true` and `immutable = true`. These also have different
behaviors. Options hidden with `enable_if = false` can't have their value
fetched using Vim script or the API, but options hidden with `hidden = true` or
`immutable = true` can. On the other hand, options with `hidden = true` do not
error when trying to set their value, but options with `immutable = true` do.
Solution:
Remove `enable_if = false`, remove the `hidden` property for options, and use
`immutable = true` to mark an option as hidden instead. Also make hidden option
variable pointers always point to the default value, which allows fetching the
value of every hidden option using Vim script and the API. This does also mean
that trying to set a hidden option will now give an error instead of just being
ignored.
Problem: The window opened :InspectTree or :EditQuery isn't closed when
the source buffer is unloaded, even though it is closed when
the buffer is hidden.
Solution: Also close the window on BufUnload.
Problem: 'findexpr' can't be used for lambads
(Justin Keyes)
Solution: Replace the findexpr option with the findfunc option
(Yegappan Lakshmanan)
related: vim/vim#15905closes: vim/vim#15976a13f3a4f5d
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Long lists of available parsers make it hard to see WASM
status.
Solution: Add separate headings for "treesitter features" (ABI, WASM)
and "treesitter parsers". Also add minimum supported ABI version.
Problem: filetype: sway files are not recognized
Solution: detect '*.sw' files as sway filetype, include
a filetype plugin (Riley Bruins)
References:
https://github.com/FuelLabs/sway.
Comments taken from their syntax documentation. File extension taken
from the same documentation/GitHub's own recognition of these file types
closes: vim/vim#1597384b5b1c660
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
- Partition the handlers in vim.lsp.handlers as:
- client to server response handlers (RCS)
- server to client request handlers (RSC)
- server to client notification handlers (NSC)
Note use string indexes instead of protocol.methods for improved
typing in LuaLS (tip: use hover on RCS, RSC or NSC).
fixes: vim/vim#15961
while at it, remove the Decho comments in the s:NetrwOptionsRestore()
function
aa2ce6f580
Co-authored-by: Christian Brabandt <cb@256bit.org>
It did not work very well, at least on Debian 12, and I am not sure Git
Bash and WSL, for example, were taken care of as maintenance stalled.
The whole logic was somewhat convoluted with some parts repeatedly invoking
failed commands.
The file handling was outdated, for example, nowadays Netscape is rarely
used, and also opinionated, for example mainly Microsoft Paint and Gimp for
Image files.
Instead, let's use (xdg-)open and similar commands on other systems
which respects the user's preferences.
closes: vim/vim#157213d7e567ea7
Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
Co-authored-by: Luca Saccarola <96259932+saccarosium@users.noreply.github.com>
`-NonInteractive` at least somewhat hints to pwsh/powershell, that shell
sessions created from :! are not interactive, though even that is not
foolproof, because powershell is weird.
`$PSStyle.OutputRendering='plaintext'` causes pwsh/powershell
to omit ANSI escape sequences in its output.
Problem: 'findexpr' completion doesn't set v:fname to cmdline argument.
Solution: Set v:fname to the cmdline argument as-is (zeertzjq).
closes: vim/vim#1593420e045f781
feat(diagnostics)!: sort underline with severity_sort
BREAKING CHANGE: underline will be applied with a higher value than `vim.hl.priorities.diagnostics`
The workspace folder name is meant to be a human-readable name which is
only used in the UI. Comparing the name against root_dir is thus not
a valid comparison. Instead, we should compare the workspace folder's
URI against the root dir URI.
Problem: novice users relying on vimtutor won't know what to do when they follow the instructions and delete a couple lines and that breaks the line checker
Solution: tell the user to fix the line numbers after they're done
* deprecate old signatures
* move to new str_byteindex/str_utfindex signature
* use single-underscore name (double-underscore is reserved for Lua itself)
Problem: We use `void *` for option default values, which is confusing and can cause problems with type-correctness. It also doesn't accomodate for multitype options. On top of that, it also leads to default boolean option values not behaving correctly on big endian systems.
Solution: Use `OptVal` for option default values.
BREAKING CHANGE:
- `:set {option}<` removes the local value for all global-local options instead of just string global-local options.
- `:setlocal {option}<` copies the global value to the local value for number and boolean global-local options instead of removing the local value.
Problem:
`lsp.buf_request` send the same params to all servers and many
calls to this pass PositionalParams which depends on the clients
offset_encoding. This can result with incorrect params being sent
to a server.
Solution:
`lsp.buf_request` `params` argument can now be passed as a function
which takes the client as the first argument. This is used in
lsp/buf.lua to construct correct params for each client request.
PROBLEM:
There are several limitations to vim.str_byteindex, vim.str_utfindex:
1. They throw given out-of-range indexes. An invalid (often user/lsp-provided)
index doesn't feel exceptional and should be handled by the caller.
`:help dev-error-patterns` suggests that `retval, errmsg` is the preferred
way to handle this kind of failure.
2. They cannot accept an encoding. So LSP needs wrapper functions. #25272
3. The current signatures are not extensible.
* Calling: The function currently uses a fairly opaque boolean value to
indicate to identify the encoding.
* Returns: The fact it can throw requires wrapping in pcall.
4. The current name doesn't follow suggestions in `:h dev-naming` and I think
`get` would be suitable.
SOLUTION:
- Because these are performance-sensitive, don't introduce `opts`.
- Introduce an "overload" that accepts `encoding:string` and
`strict_indexing:bool` params.
```lua
local col = vim.str_utfindex(line, encoding, [index, [no_out_of_range]])
```
Support the old versions by dispatching on the type of argument 2, and
deprecate that form.
```lua
vim.str_utfindex(line) -- (utf-32 length, utf-16 length), deprecated
vim.str_utfindex(line, index) -- (utf-32 index, utf-16 index), deprecated
vim.str_utfindex(line, 'utf-16') -- utf-16 length
vim.str_utfindex(line, 'utf-16', index) -- utf-16 index
vim.str_utfindex(line, 'utf-16', math.huge) -- error: index out of range
vim.str_utfindex(line, 'utf-16', math.huge, false) -- utf-16 length
```
Co-authored-by: David Pedersen <limero@me.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Leo Schlosser <Leo.Schlosser@Student.HTW-Berlin.de>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Problem:
Hidden options are documented despite being no-ops.
Solution:
Remove docs for hidden options.
Move tags for options that we plan to restore, to ":help nvim-missing".
Move tags for permanently removed options, to ":help nvim-removed".
Problem: testing of options can be further improved
Solution: split the generated option test into test_options_all.vim,
add more test cases, save and restore values, fix use-after-free
closes: vim/vim#158946eca04e9f1
Co-authored-by: Milly <milly.ca@gmail.com>
Problem:
`vim.validate()` takes two forms when it only needs one.
Solution:
- Teach the fast form all the features of the spec form.
- Deprecate the spec form.
- General optimizations for both forms.
- Add a `message` argument which can be used alongside or in place
of the `optional` argument.
Problem:
- `vim.highlight` module does not follow `:help dev-name-common`, which
documents the name for "highlight" as "hl".
- Shorter names are usually preferred.
Solution:
Rename `vim.highlight` to `vim.hl`.
This is not a breaking change until 2.0 (or maybe never).
vim-patch:8.2.4744: a terminal window can't use the bell
vim-patch:8.2.4745: using wrong flag for using bell in the terminal
BREAKING CHANGE: Bells from :terminal are now silent by default, unless
'belloff' option doesn't contain "term" or "all".
Problem:
If there are multiple LSP clients, it's not clear which actions are provided by which servers. #30710
Solution:
Show the server name next to each action (only if there are multiple clients).