Selection hint that is displayed immediately upon entering visual mode
([<leader>aa: ask, <leader>ae: edit]) gets old pretty quickly. Add a
config option to control when the hint is displayed:
selection = {
enabled = true,
hint_display = "delayed",
},
The "hint_display" option recognizes the following values:
- "immediate" results in the hint being shown immediately after entering
visual mode. This is the old behavior.
- "delayed" causes the hint be displayed only if the cursor has not been
moved for vim.o.updatetime milliseconds. This is the new default.
- "none" suppresses showing the hint completely.
Unfortunately "CursorHold" event is not emitted in visual mode so we
have to emulate it using Utils.debounce().
This is a breaking change because selection behavior was controller by
"hints" config entry which makes little sense, so the config section and
associated commands were renamed to "selection".
Additionally the "hints"/"selection" was mapped to "<leader>ah", but the
very same key combination was used to select from old Avante chat
histories, which overrode the toggle. New selection toggle keymap is
"<leader>aC".
Between Utils.prepend_line_number() and its only caller, there is a lot
of conversions from list to string to list and back to string. Simplify
all of this by making it accept and return a list of strings, which
avoids unnecessary splitting and joining.
The implementation was updated to use vim.iter():map() and
string.format() for better performance and to align with the idiomatic
functional style used elsewhere in the project.
The name of the function has also been tweaked and is now
"prepend_line_numbers()" to better reflect that it operates on a list of
strings.
The caller has been updated to match the new function signature.
Git may complain if init.defaultBranch is not set up on the system:
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
hint:
hint: Disable this message with "git config set advice.defaultBranchName false"
Use "git init -m main" to suppress this message.
Adds a new scripts/run-luatest.sh script to provide a consistent,
self-contained way to run project unit tests, including locally.
The script handles:
- Checking for necessary tools (rg, ag)
- Cloning or updating plenary.nvim into the target/tests/deps directory
The Makefile is updated to use this new script, making make luatest the
single entry point for running unit tests.
The lua.yaml workflow is simplified to use this new make target,
ensuring the CI environment uses the exact same testing logic.
This implements mode mirroring github workflow in scripts/lua-typecheck.sh
so that it can run locally.
A supporting script scripts/setup_deps.sh is created to define and
download/clone dependencies (plugins), as well as download luals, neovim
runtime, and create luarc.json. setup_deps.sh is now the only and
authoritative source of dependencies and luals version. Neovim version
still comes from lua.yaml.
To fetch neovim version from lua.yaml as well as figure out the right
source of neovim package, dependency on yq is introduced when running
locally in "managed" mode.
Dependencies, neovim runtime, and luals are downloaded to
target/tests subdirectory on local machine. luarc.json is created
from a template there as well.
The ability to run against the live system is preserved with "--live"
option. In this case it assumes that neovim is using lazy package
manager and optionally Mason, so if luals is not present in path the
script will try to see if it is installed by Mason.
When running in github CI neovim is set up through github action while
dependencies and luals are handled by the scripts.