Commit Graph

1184 Commits

Author SHA1 Message Date
brook hong
2791db9984 fix: stop timer for retry on canceling inflight request (#2637)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2025-08-24 16:31:57 +08:00
忍野ペンギン
8a2ed691c0 fix: handle is already closing (#2613)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2025-08-24 16:21:55 +08:00
brook hong
b3289ff51a fix: wrap user input in task only in agentic mode (#2636) 2025-08-24 15:47:30 +08:00
brook hong
40af7113a2 Add option custom_init to enable user to customize behaviour of sidebar (#2630)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2025-08-24 02:57:52 +08:00
Ahmed Siddiqui
212797a2f2 Add config to limit max height for selected files (#2618) 2025-08-19 15:39:08 +08:00
samuelm00
0a603efad1 add possibility to define a project based instruction file 2025-08-19 14:53:40 +08:00
Dmitry Torokhov
fed6902c9a feat!(selection): do not display hint immediately
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".
2025-08-16 14:45:52 +08:00
yetone
bd2079a5cc chore: remove dead code and commented out blocks (#2611) 2025-08-16 14:45:27 +08:00
brook hong
c1ccb7867a fix: remove trailing spaces each line when editing files (#2612) 2025-08-16 14:16:38 +08:00
yetone
be0937a459 fix: timer already closed (#2608) 2025-08-14 17:55:24 +08:00
Peter Cardenas
59ba16202e fix: lazy load AvanteEdit (#2602) 2025-08-13 20:11:27 +08:00
yetone
1e0c8520bc fix: the last used model caused the loss of the model configured in the profile in the model selector (#2600) 2025-08-12 15:33:31 +08:00
Dmitry Torokhov
638d237b75 refactor(utils): make prepend_line_numbers() more efficient and idiomatic
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.
2025-08-12 15:14:37 +08:00
Dmitry Torokhov
76fe3f615a refactor(utils): switch debounce() and throttle() to use vim.defer_fn()
vim.defer_fn() does exactly what half of Utils.debounce() and
Utils.throttle() code does, so use it.

While at it add function annotations.
2025-08-12 15:14:37 +08:00
you-n-g
16c58c2e6f fix: update config.lua default value for gpt-5-chat (#2594) 2025-08-12 15:13:44 +08:00
Peter Cardenas
dd151e7f45 fix: allow lazy loading AvanteAskNew (#2598) 2025-08-12 15:13:20 +08:00
brook hong
5a4ed4ac92 feat: add mappings to toggle code window from input in sidebar (#2591) 2025-08-08 20:11:06 +08:00
brook hong
2fc63d4128 feat: toggle code window from result container in sidebar (#2579) 2025-08-06 11:39:38 +08:00
yetone
6bcf7dfbe7 fix: still use str_replace_editor (#2587) 2025-08-06 11:39:13 +08:00
Dmitry Torokhov
70a73d4f98 fix(config): remove last used model data if it is damaged (#2580) 2025-08-05 15:44:13 +08:00
brook hong
6f28f132e5 fix: failed to write correct entry into prompt log file at very begin… (#2581) 2025-08-05 15:19:35 +08:00
yetone
b941cd902d chore: update input height from 6 to 8 (#2582) 2025-08-04 20:55:01 +08:00
brook hong
66cfbb4c19 fix: re-implement prompt logger (#2574)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-03 21:34:38 +08:00
yetone
03f0456d30 fix: add nil check for message before sending notifications 2025-08-02 23:38:21 +08:00
yetone
f475e95eb7 fix: add buffer validation checks in replace_in_file 2025-08-02 17:57:31 +08:00
yetone
657b418c46 fix: check if path is a directory before opening it 2025-08-02 17:53:07 +08:00
PlacidFireball
6d372a9135 fix: set the content property to the empty string (#2566)
Co-authored-by: Jared Weiss <jared.weiss@quiq.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2025-08-02 15:37:19 +08:00
brook hong
7965546a34 fix: do not ask for API key for bedrock if aws_profile was set (#2564) 2025-08-02 13:00:00 +08:00
yetone
b225094dca fix: breaklines within the content (#2567) 2025-08-02 12:56:20 +08:00
Umut Sahin Onder
6c2a785ebb fix(config): suppress last model info messages if redundant
Only show "Using last model" notification when the loaded model
differs from the original configuration to reduce UI noise
2025-07-31 21:30:41 -07:00
Shogo Nakamoto
ca63356a99 feat: allow overriding bedrock provider endpoint (#2540) 2025-07-31 14:15:34 +08:00
Dmitry Torokhov
5bc4ffa19f refactor(bedrock): replace vim.uv.spawn() with vim.system()
Instead of implementing synchronous call to a command line utility via
vim.uv.spawn() switch to using vim.system(). Its return value (object)
wait() method allows to specify timeout too.

This makes code much simpler.
2025-07-31 14:12:13 +08:00
Dmitry Torokhov
d737fa6109 build: remove presubmit dependency on luvit-meta
As discussed in https://github.com/yetone/avante.nvim/pull/2536 the
project should either use luv bindings from luals or luvit-meta
library, but not both, as they conflict with each other (especially
with uv.uv_timer_t). Given that other projects such as kickstart.nvim
and lazydev.nvim are switching to use the former, we should do the same
and drop luvit-meta dependency.

Also adjust code that was using luvit-meta's annotations for timers.
2025-07-31 14:12:13 +08:00
skt041959
d77e1272a0 fix: check before set keymap (#2543) 2025-07-30 22:17:28 +08:00
yetone
8c5b3f9706 fix: duplicated replace blocks in diff (#2549) 2025-07-30 22:16:56 +08:00
NekoNekoNiko120
5e4eb8652b feat: remember the last selected model (#2518)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: yetone <yetoneful@gmail.com>
2025-07-28 13:21:49 +08:00
yetone
7e50de8904 fix: ReAct tool use format in few-shot (#2542) 2025-07-28 11:14:45 +08:00
yetone
0a2143586a fix: incorrect json in tool_use example (#2541) 2025-07-28 11:03:01 +08:00
Marcos Romero Lamas
daa419c79b fix: statusline hidden in Avante (#2477) 2025-07-27 14:57:24 +08:00
Peter Cardenas
d8ec4e4aa4 fix: gracefully handle html2md failure (#2533) 2025-07-26 16:19:38 +08:00
Dmitry Torokhov
53dcb55896 fix(sidebar): keep header aligned when sidebar width changed (#2535) 2025-07-26 16:16:23 +08:00
yetone
8bc149ccd8 fix: react prompts (#2537) 2025-07-26 16:06:56 +08:00
Amaury Cannesson
bd69ae14f6 fix(utils): fix gsub in trim_line_numbers() (#2528) 2025-07-24 17:47:10 +08:00
yetone
1452c7233b fix: invalid json format (#2531) 2025-07-24 17:37:10 +08:00
yetone
02aa0a4241 fix: compatible with some incorrect tool results (#2530) 2025-07-24 16:44:05 +08:00
yetone
7af303b421 fix: missing curl error message (#2527) 2025-07-24 16:03:15 +08:00
yetone
ca1271c996 fix: use path instead of target_file in the edit_file input (#2526) 2025-07-24 15:37:26 +08:00
yetone
57311d80ea fix: not enough room (#2525) 2025-07-24 14:33:16 +08:00
yetone
f199625ee4 fix: diff format in k2 v2 (#2524) 2025-07-24 14:31:03 +08:00
yetone
430cac8d91 feat: introduce beast-mode-3.1 (#2523) 2025-07-24 14:16:21 +08:00