Problem: When pumborder is set, the scrollbar still occupies
a column on the screen, wasting a 1 column of space.
Solution: Render the scrollbar on the right/left (rl mode) side
of the border when pumborder is set.
Problem: `PackChanged[Pre]` events with `kind=update` are triggered both
during plugin's initial installation and after already installed
plugin was updated.
It was a deliberate decision to allow writing only a single update
hook to act as a dedicated "build" entry point (like execute `make` or
`cargo build —release`). This mimics how other plugin managers have a
single "build" command.
This was a result of 'mini.deps' experience with the different
approach: "update" hooks are not run during install. This proved to be
confusing as it requires to write two hooks. But also the reason might
be that 'mini.deps' names it "checkout" hook instead of "update".
However, the `vim.pack` event approach makes it lower cost to handle
separate "update" and "install" events. Something like
`if ev.data.kind == 'install' or ev.data.kind == 'update' then`
instead of two autocommands.
Plus this makes clearer separation of events.
Solution: do not trigger `PackChanged[Pre] kind=update` event during
install.
Problem: Inside `PackChanged[Pre]` callbacks it might be useful to tell
if the affected plugin is active or not. It is already possible via
extra `vim.pack.get({ 'plug-name' })[1].active`, but it is not quite
user-friendly for something that might be needed frequently in real
world use cases.
Solution: Supply extra `active` event data field.
Problem: 'pack_spec.lua' test file's code can be improved.
Solution: Refactor some aspects. In particular:
- Rewrite `find_in_log` for finding event data in event log into a
generator function that from log list returns a finder function.
This allows it to take less arguments and be more concise.
- Consistently use `local function f()` instead of
`local f = function()`.
- Prefer to use `fn.readblob()` instead of `fn.readfile()` to assert
text from a file.
- Use `([[...]]):format()` approach to testing file content (instead
of array of strings). Should improve readability.
- Universally prefer using "assert" to mean "check if certain
expectation about the process holds up" (instead of occasional
"validate").
Follow-up to #33721.
This doesn't seem to affect actual behavior for now, as these two lines
seem only reachable when the 'scrollback' option is changed, and options
can currently only be changed in the current buffer.
This warning doesn't really make sense, since the `enable()` call is
meant to be run before the `lsp.config` calls. It will be logged many
times (once for each enabled LSP) at startup.
This is especially annoying because calling `enable()` after
configuration causes the first opened buffer not to have its filetype
set in some situations. This is a separate bug which really needs to be
fixed, and makes this superfluous logging more likely.
Problem: MS-Windows: Relative import in a script sourced from a buffer
doesn't work (Ernie Rael)
Solution: Set a filename, so that we are not trying to use
script-relative filename (Yegappan Lakshmanan)
When a script is sourced from a buffer, the file name is set to ":source
buffer=". In MS-Windows, the ":" is a path separator character (used
after a drive letter). This results in the code trying to use the ":"
prefix to import the script on MS-Windows. To fix this, when importing a
script from a script sourced from a buffer with nofile, don't use
a script relative path name.
fixesvim/vim#14588closes: vim/vim#14603f135fa28e4
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Illegal byte regexp test doesn't fail when fix is reversed.
Solution: Make sure illegal bytes end up in sourced script file.
cb36c2a3cd
Co-authored-by: Bram Moolenaar <Bram@vim.org>
The current implementation has a race condition where items are appended
to the completion list twice when a second completion runs while the
first is still going. This hotfix just deduplicates the entire list.
Co-authored-by: Tomasz N <przepompownia@users.noreply.github.com>
Problem:
Border width calculations were scattered with repeated
`*p_pumborder != NUL ? 2 : 0` patterns. The "none" value was not
consistently checked, causing borders to appear when pumborder="none".
When "shadow" the info floating window have an extra cell of spacing.
Solution:
Add `pum_border_width()` helper that returns 0 when pumborder is unset
or "none" (opt_winborder_values[7]), returns 1 when pumborder is shadow,
otherwise return 2.
Problem: Crash when allocating signal stack fails.
Solution: Only using sourcing info when available. (closesvim/vim#9215)
0bd8d05638
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Coverity warns for not checking allocation failure.
Solution: Check that allocating a list or blob succeeded.
12553ada3b
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: v:register is wrong in v_: command (after 9.1.1858).
Solution: Don't reset v:register for OP_COLON (zeertzjq)
related: https://github.com/vim/vim/pull/18583#issuecomment-3418030021closes: vim/vim#185970124320c97
While at it, also fix using stale set_prevcount value. That only matters
when readbuf1 ends with an operator or a register, which never happens,
but it's still good to avoid using a stale value.
The processing of terminfo can be separated into two steps:
1. The initialization of terminfo, which includes trying to find $TERM
in a terminfo database file. As a fallback, common terminfo
definitions are compiled in. After this, we apply a lot of ad-hoc
patching to cover over limitations of terminfo.
2. While processing updates from nvim, actually using terminfo strings
and formatting them with runtime values. for this part, terminfo
essentially is a hyper-enhanced version of snprintf(), including
a sm0l stack based virtual machine which can manipulate the runtime
parameters.
This PR completely replaces libuniblium for step 2, with code
vendored from NetBSD's libtermkey which has been adapted to use typesafe
input parameters and to write into an output buffer in place.
The most immedatiate effects is a performance enhancement of
update_attrs() which is a very hot function when profiling the
TUI-process part of screen updates. In a stupid microbenchmark
(essentially calling nvim__screenshot over and over in a loop) this
leads to a speedup of ca 1.5x for redrawing the screen on the TUI-side.
What this means in practise when using nvim as a text editor is probably
no noticible effect at all, and when reabusing nvim as idk a full screen
RGB ASCII art rendrer maybe an increase from 72 to 75 FPS LMAO.
As nice side-effect, reduce the usage of unibilium to initialization only..
which will make it easier to remove, replace or make unibilium optional,
adressing #31989. Specifically, the builtin fallback doesn't use
unibilium at all, so a unibilium-free build is in principle possible
if the builtin definitions are good enough.
As a caveat, this PR doesn't touch libtermkey at all, which still has a
conditional dependency on unibilium. This will be investigated in a
follow-up PR
Note: the check of $TERMCOLOR was moved from tui/tui.c to
_defaults.lua in d7651b27d5 as we want to
skip the logic in _defaults.lua if the env var was set, but there
is no harm in TUI getting the right value when the TUI is trying to
initialize its terminfo shenanigans. Also this check is needed when
a TUI connects to a `--headless` server later, which will observe
a different $TERMCOLOR value than the nvim core process itself.
* x64: Add support for CET IBT.
* Gracefully handle broken custom allocator.
* Add GNU/Hurd build support.
* Fix io.write() of newly created buffer.
* Fix reporting of an error during error handling.
Problem: completion: whitespace not cleared with 'ai'
Solution: Remove spaces added by 'autoindent' when autocomplete is set
and restore did_ai in ins_compl_start() (Maxim Kim)
fixesvim/vim#18560closes: vim/vim#185826180d65751
Co-authored-by: Maxim Kim <habamax@gmail.com>
docs: fix issue query in github templates
Problem:
Error "Filter contains 1 issue: Invalid value enhancement for label" when
clicking on the "existing feature requests" links in the github feature
template or github lsp bug template.
Solution:
Update the queries to use the new type:Enhancement categorization instead of the
old label:enhancement system.
Similar to #36107.
docs(lsp): specify exactly how `vim.lsp.config` merges configs…
Problem:
It already says that the behaviour is defined by `vim.tbl_deep_extend`,
but that can mean very different things depending on the `behavior`
parameter.
Solution:
Specify that it uses "force".
Problem: v:register not reset after Visual mode command.
(laktak)
Solution: Reset v:register if Visual mode was active before
do_pending_operator() (zeertzjq)
fixes: vim/vim#18579
related: vim/vim#5305closes: vim/vim#18583b3b47e540d
vim-patch: 8.1.1985: code for dealing with paths is spread out
vim-patch:8.2.0375: Coverity warning for not using return value
vim-patch:8.2.0471: missing change to compile_list()
vim-patch:8.2.0489: Vim9: memory leaks
vim-patch:8.2.0494: Vim9: asan error
vim-patch:8.2.0685: Build failure
vim-patch:8.2.0759: Vim9: missing changes for performance improvements
vim-patch:8.2.1740: test fails without the terminal feature
vim-patch:8.2.1742: test still fails without the terminal feature
vim-patch:8.2.1880: Vim9: asan complains about adding zero to NULL
vim-patch:8.2.1958: build failure with timers
vim-patch:8.2.2248: ASAN error on exit with GUI
vim-patch:8.2.2273: build failure
vim-patch:8.2.2382: build failure
vim-patch:8.2.2401: build fails without +profiling feature
vim-patch:8.2.2536: Coverity complains about unchecked return value
vim-patch:8.2.2599: build failure
vim-patch:8.2.2715: Vim9: tests fail without the channel feature
vim-patch:8.2.2987: build failure with normal features
vim-patch:8.2.3092: Vim9: builtin function test fails without +channel feature
vim-patch:8.2.3291: Coverity warns for not checking return value
vim-patch:8.2.3505: Vim9: build failure without the +eval feature
vim-patch:8.2.3541: compiler warning for unused variable in tiny version
vim-patch:8.2.3546: build failure without the +eval feature
vim-patch:8.2.3563: build failure with +eval but without GUI or +termguicolors
vim-patch:8.2.3566: build failure on old systems when using nano timestamp
vim-patch:8.2.3621: build failure
vim-patch:8.2.3636: Coverity warns for unreachable code
vim-patch:8.2.3672: build failure with unsigned char
vim-patch:8.2.3691: build failure with small features
vim-patch:8.2.3693: Coverity warns for possibly using a NULL pointer
vim-patch:8.2.3718: compiler warns for unused variable without +textprop
vim-patch:8.2.3724: build error for missing error message in small build
vim-patch:8.2.3736: test fails without the channel feature
vim-patch:8.2.3740: memory left allocated on exit when using Tcl
vim-patch:8.2.3752: build error when using Photon GUI
vim-patch:8.2.3791: build error with +cindent but without +smartindent
vim-patch:8.2.3868: Vim9: function test fails
vim-patch:8.2.3926: build failure without the 'autochdir' option
vim-patch:8.2.3931: Coverity reports a memory leak
vim-patch:8.2.3958: build failure compiling xxd with "-std=c2x"
vim-patch:8.2.3963: build failure with tiny and small features
vim-patch:8.2.3988: tiny build fails
vim-patch:8.2.3998: asan error for adding zero to NULL
vim-patch:8.2.4015: build failure with tiny features
vim-patch:8.2.4034: Coverity warns for possibly using a NULL pointer
vim-patch:8.2.4042: Vim9: build error
vim-patch:8.2.4054: Vim9 script test fails
vim-patch:8.2.4079: MS-Windows: "gvim --version" didn't work with VIMDLL
vim-patch:8.2.4081: CodeQL reports problem in if_cscope causing it to fail
vim-patch:8.2.4119: build failure when disabling the channel feature
vim-patch:8.2.4127: build failure without the +eval feature
vim-patch:8.2.4150: Coverity warns for using pointer after free
vim-patch:8.2.4239: build fails with unusual configuration
vim-patch:8.2.4272: Vim9 expr test fails without the channel feature
vim-patch:8.2.4278: build with Athena GUI fails
vim-patch:8.2.4300: cannot build tiny version
vim-patch:8.2.4368: Amiga: a few compiler warnings
vim-patch:8.2.4369: redundant #ifdef argument
vim-patch:8.2.4385: cannot build tiny version
vim-patch:8.2.4386: still cannot build tiny version
vim-patch:8.2.4405: compiler warning for unused variable without +folding
vim-patch:8.2.4413: Vim9: Coverity warns for using NULL pointer
vim-patch:8.2.4470: Coverity warns for uninitialized variable
vim-patch:8.2.4488: build error with +eval but without +channel or +job
vim-patch:8.2.4516: build failure without the +eval feature
vim-patch:8.2.4521: build failure without the +diff feature
vim-patch:8.2.4532: suspending with CTRL-Z does not work on OpenBSD
vim-patch:8.2.4549: cannot build with Motif and editres
vim-patch:8.2.4550: Motif: cannot set the color of the scrollbar thumb
vim-patch:8.2.4556: test fails without the +job or +channel feature
vim-patch:8.2.4560: suspending with CTRL-Z does not work on DragonFlyBSD
vim-patch:8.2.4654: missing changes for import check
vim-patch:8.2.4680: build failure without +postscript
vim-patch:8.2.4681: build fails with a combination of features
vim-patch:8.2.4725: unused variable in tiny build
vim-patch:8.2.4756: build error without the +eval feature
vim-patch:8.2.4769: build warning with UCRT
vim-patch:8.2.4771: Coverity warns for not checking return value
vim-patch:8.2.4815: cannot build with older GTK version
vim-patch:8.2.4863: accessing freed memory in test without the +channel feature
vim-patch:8.2.4878: valgrind warning for using uninitialized variable
vim-patch:8.2.4884: test fails without the job/channel feature
vim-patch:8.2.4898: Coverity complains about pointer usage
vim-patch:8.2.4900: Vim9 expression test fails without the job feature
vim-patch:8.2.4976: Coverity complains about not restoring a saved value
vim-patch:8.2.5021: build fails with normal features and +terminal
vim-patch:8.2.5067: timer_create is not available on every Mac system
vim-patch:8.2.5071: with some Mac OS version clockid_t is redefined
vim-patch:8.2.5125: MS-Windows: warnings from MinGW compiler
vim-patch:8.2.5133: MacOS: build fails
vim-patch:8.2.5137: cannot build without the +channel feature
vim-patch:8.2.5168: cannot build with Python 3.11
vim-patch:9.0.0123: cannot build with small features
vim-patch:9.0.0159: cannot build with small features
vim-patch:9.0.0161: warning for uninitialized variable
vim-patch:9.0.0237: Mac: cannot build if dispatch.h is not available
vim-patch:9.0.0256: compiler warning for uninitialized variables
vim-patch:9.0.0378: compiler warning for uninitialized variable
vim-patch:9.0.0413: ASAN reports a memory leak
vim-patch:9.0.0462: ASAN warning for integer overflow
vim-patch:9.0.0970: Coverity warns for uninitialized variable
vim-patch:9.0.1042: ASAN gives false alarm about array access.
vim-patch:9.0.1076: ASAN complains about NULL argument
vim-patch:9.0.1085: compiler warns for uninitialized variable
vim-patch:9.0.1666: compiler may warn for uninitialized variable
vim-patch:9.1.0816: tests: not clear what tests cause asan failures
vim-patch:9.1.1345: tests: Test_xxd_color2() test failure dump diff is misleading
Problem: when create a hidden terminal job with `nvim_buf_call`+
`jobstart(…,{term=true})`, program like `lazygit` cannot figure out the
correct width and height.
Solution: `jobstart(…,{term=true})` accepts `width`/`height`
Problem: if pumblend >= 50, non-whitespace menu character gets italic,
bold, underline (or similar) attribute from the cell underneath, which
is not really useful and can't be "blended".
Solution: drop highlight combination for that special case (@zeertzjq
on #36133).
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Problem:
If a client doesn't have a config then an error may be thrown.
Probably caused by: 2f78ff816b
Lua callback: …/lsp.lua:442: attempt to index local 'config' (a nil value)
stack traceback:
…/lsp.lua:442: in function 'can_start'
…/lsp.lua:479: in function 'lsp_enable_callback'
…/lsp.lua:566: in function <…/lsp.lua:565>
Solution:
Not all clients necessarily have configs.
- Handle `config=nil` in `can_start`.
- If user "enables" an invalid name that happens to match a *client*
name, don't auto-detach the client.