* refactor: format with uncrustify
* fixup(dundar): fix functions comments
* fixup(dundar): remove space between variable and ++/--
* fixup(dundar): better workaround for macro attributes
This is done to be able to better use uncrustify rules for macros
* fixup(justin): make preprocessors follow neovim style guide
Continuation of https://github.com/neovim/neovim/pull/15202
A plugin like telescope could override it with a fancy implementation
and then users would get the telescope-ui within each plugin that
utilizes the vim.ui.select function.
There are some plugins which override the `textDocument/codeAction`
handler solely to provide a different UI. With custom client commands and
soon codeAction resolve support, it becomes more difficult to implement
the handler right - so having a dedicated way to override the picking
function will be useful.
In vim.lsp.buf.references, the key vim.type_idx (which evaluates to a
boolean) was set to equal vim.types.dictionary. This resulted in a
boolean key in json which is not allowed by the json spec, and which
lua-cjson fails to serialize.
Rather than relying on the order in which signs are placed to dictate
the order in which they are displayed, explicitly set the priority of
the sign according to the severity of the diagnostic and the value of
severity_sort. If severity_sort is false or unset then all signs use the
same priority.
Initially, we planned to set the NVIM environment variable to detect that
neovim is running in the neovim built-in terminal. At the time this code
was written, there was no way for a parent to set environment variables
for a program running in an embedded terminal. Later it was implemented in
#12937, but the code to set the NVIM was not added. #11390 now uses ConPTY
instead of winpty when possible, so it is no longer necessary to force the
use of win32con even when running inside an embedded terminal. Therefore,
we now do not need this code.
site packages must be sourced before user config
NOTE: we only consider dirs exactly matching "after" to be an AFTER dir.
vim8 considers all dirs like "foo/bar_after", "Xafter" etc, as an
"after" dir in SOME codepaths not not in ALL codepaths.
* add vim.json.encode and vim.json.decode
* use vim.NIL instead of cjson.null
* resolve strict-prototypes warnings
* The following benchmark shows an approximately 2.5x (750 ms vs 300 ms) improvement in deserialization performance over
vim.fn.json_decode on a medium package.json
```lua
local uv = vim.loop
local function readfile(path)
return
end
local json_url = "https://raw.githubusercontent.com/rust-analyzer/rust-analyzer/b24c8d5c89ee93d1172b4127564f5da3b0c88dad/editors/code/package.json"
io.popen(string.format('curl -v -f -L -O %q &> /dev/null', json_url))
local json_string = io.open('package.json'):read '*a'
uv.update_time()
local start = uv.hrtime()
for i = 1,1000 do
vim.fn.json_decode(json_string)
end
uv.update_time()
print(string.format("Deserialization time vim.fn.json_decode: %s ms", (uv.hrtime() - start) * (1e-6)))
uv.update_time()
local start = uv.hrtime()
for i = 1,1000 do
vim.json.decode(json_string)
end
uv.update_time()
print(string.format("Deserialization time vim.json.decode: %s ms", (uv.hrtime() - start) * (1e-6)))
```
Co-Authored-By: Björn Linse <bjorn.linse@gmail.com>
Problem:
This crashes Nvim:
tabedit
call nvim_win_set_option(1000, 'statusline', 'status')
split
wincmd J
wincmd j
Solution:
- Change `no_display` parameter value to be the same as in matching
`restore_win_noblock` call. In case of different values `topframe`
isn't restored to `curtab->tp_topframe`.
- Call `restore_win_noblock` if `switch_win_noblock` returns `FAIL`
(`switch_win` must always have matching `restore_win`)
- Change `switch_win`/`restore_win` to `_noblock` versions to allow
autocommands.
fixes#14097fixes#13577
Fix was already applied in 5f144efefa#15688,
but this commit adds another dimension to the test.
Test correctly fails after reverting 5f144efefa.
ref #15288