62 Commits

Author SHA1 Message Date
yetone
00224ea378 fix: use acp to editing (#2701) 2025-09-11 18:39:00 +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
Dmitry Torokhov
30eb77af04 feat: optimize showing hints in visual mode (#2416) 2025-07-08 19:56:54 +08:00
yetone
86743a1d7d fix: resolve LSP sync error when setting buffer lines (#2290) 2025-06-21 21:16:55 +08:00
yetone
6e1e2ac9f2 feat: automatically obtain diagnostics after finishing editing the file (#2018) 2025-05-08 22:50:46 +08:00
zenk
48a415ef01 feat(window): add height&width option for editing window (#1913)
Co-authored-by: zhangkai.zju <zhangkai.zju@bytedance.com>
2025-04-30 13:59:54 +08:00
yetone
9952ad381c fix: extracting code (#1855) 2025-04-11 10:51:17 +08:00
guanghechen
f97352e95d fix(hints-popup): don't show the hints-popup on the terminal buffer (#1847) 2025-04-11 10:20:00 +08:00
aniaan
07105d8e31 fix: update autocmd for CursorMoved event in selection.lua (#1848) 2025-04-11 10:19:37 +08:00
yetone
d76a158b61 feat: custom slash commands (#1826) 2025-04-07 22:19:59 +08:00
Jae-Won Chung
40ffc0f5fa Use vim.hl if available (#1809) 2025-04-07 15:04:37 +08:00
yetone
0828d32346 fix: AvanteEdit command (#1799) 2025-04-02 16:27:10 +08:00
yetone
76fd19812e feat: accept all (#1764) 2025-03-30 12:51:15 +08:00
yetone
8b730182cb refactor: ui lib (#1642) 2025-03-19 14:34:32 +08:00
yetone
868c136574 refactor: remove use_xml_format (#1535) 2025-03-09 14:58:30 +08:00
yetone
814bba5ef2 fix: edit supports think tag (#1430) 2025-02-28 15:24:36 +08:00
Peter Cardenas
afa674c6fd chore: prefer not to use function assignment (#1381) 2025-02-25 12:08:03 +08:00
yetone
b21d2632d3 feat: cursor planning mode (#1289) 2025-02-17 18:49:29 +08:00
yetone
1437f319d2 feat: tools (#1180)
* feat: tools

* feat: claude use tools

* feat: openai use tools
2025-02-05 22:39:54 +08:00
yetone
078e9312dc fix: filter out redundant backticks in editing mode (#1039) 2025-01-05 21:15:21 +08:00
Michael Gendy
e98fa46bec feat(tokens): add token count display to sidebar (#956)
* feat (tokens) add token count display to sidebar

* refactor: calculate the real tokens and reuse input hints to avoid occlusion

---------

Co-authored-by: yetone <yetoneful@gmail.com>
2024-12-17 20:43:25 +08:00
Christopher Brewin
78dd9b0a6d feat(context): add a ui for selecting and adding files to the sidebar as context (#912)
* feat(sidebar): supports select files

chore (context) update add type annotations to context functions

chore (sidebar) remove unused notify function call

refactor (sidebar) remove setting search file to file path

chore (sidebar) remove nvim_notify debugging api call

* feat (files) allow selecting a file by string via cmp suggestion menu

* chore (context) refactor to allow context using @file with a context view

* refactor (context) refactor seletected file types as an array of path and content

* refactor (config) remove unused configuration options

* refactor (sidebar) remove unused unbild key

* refactor (context) remove unused imports

* refactor (mentions) update mentions to support items with callback functions and removal of the underlying selection.

* fix (sidebar) add file context as a window that is visitable via the tab key

* refactor (file_content) remove file content as an input to llm

* feat (sidebar) support suggesting and applying code in all languages that are in the context

* feat (sidebar) configurable mapping for removing a file from the context.

* feat (context_view) configure hints for the context view for adding and deleting a file.

* feat (context) add hints for the context view.

* fix (sidebar) type when scrolling the results buffer.

* refactor (selected files) refactor llm stream to accept an array of selected file metadata

* refactor: context => selected_files

---------

Co-authored-by: yetone <yetoneful@gmail.com>
2024-12-12 01:29:10 +08:00
Jay Zhang
7413d5a508 fix: avoid ignorable error in ubuntu 22.04+ (#903) 2024-11-25 20:26:23 +08:00
yetone
67e946ef13 fix: diagnostics lnum starts with 1 (#892) 2024-11-23 23:08:10 +08:00
yetone
9042f5f202 feat: enable diagnostics (#891) 2024-11-23 21:49:33 +08:00
yetone
9d0e1cd4af fix: align lua oop (#889) 2024-11-23 20:23:05 +08:00
Maddison Hellstrom
964715be64 feat: floating input (#721)
* feat: add floating input to ask method

Open a floating input similar to the "edit" input for the "ask" input.
Enabled in config via `Config.windows.ask.floating` or by passing
`{ floating = true }` to the `api.ask` method.

Includes logic to ensure the sidebar uses the correct buffer and selection
if an existing sidebar is open for another code buffer.

Also refactored the `selection` module to extract the floating input
logic into a new `PromptInput` class.

* docs: update config options

* feat: more accurate annotations to prevent user misunderstandings

---------

Co-authored-by: yetone <yetoneful@gmail.com>
2024-10-15 11:22:34 +08:00
yetone
895b0f4143 fix: get selection range from previous visual mode (#689) 2024-10-08 16:29:18 +08:00
yetone
0705234991 refactor: planning mode user prompt use aider prompt (#671) 2024-09-30 19:38:31 +08:00
yetone
0d90c047ef feat: avante repo map rust crate (#628) 2024-09-26 03:45:49 +08:00
yetone
8e1018fef7 feat: repo map (#496)
* feat: repo map

* chore: remove breakline

* chore: remove spaces

* fix: golang public method

* feat: mentions for editing input
2024-09-23 18:52:26 +08:00
Evgeny Naumov
de9f36fc2f fix(hl): use global namespace (closes #563) (#590)
* add AvantePopupHint and AvanteInlineHint hl groups

* Update lua/avante/sidebar.lua

* chore: update styling

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>

---------

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
Co-authored-by: Aaron Pham <Aaronpham0103@gmail.com>
Co-authored-by: Aaron Pham <contact@aarnphm.xyz>
2024-09-15 10:53:33 -04:00
Aaron Pham
29e109e447 feat(api): support native chat mode (#541)
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
2024-09-05 02:43:31 -04:00
Aaron Pham
d7d476ddf5 chore(secrets): support table of string (#500)
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
2024-09-03 21:47:01 -04:00
Aaron Pham
0d8098e4eb fix(style): add parentheses (#471)
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
2024-09-03 05:12:07 -04:00
Aaron Pham
e8c71d931e chore: run stylua [generated] (#460)
* chore: add stylua

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>

* chore: running stylua

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>

---------

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
2024-09-03 04:19:54 -04:00
Aaron Pham
4ad913435c feat(templates): avanterules filetype support (closes #254) (#466)
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
2024-09-03 04:09:13 -04:00
yetone
65e1e178f5 feat: automatic suggestion (smart tab) (#455) 2024-09-03 14:03:59 +08:00
Aaron Pham
7266661413 feat(api): enable customizable calls functions (#457)
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
2024-09-02 12:22:48 -04:00
yetone
6b11ac7fd5 perf(selection): reduce the number of times indentation is calculated (#412) 2024-08-31 13:29:28 +08:00
yetone
2a0a8684cf fix(selection): cursor out of range when restoring (#411) 2024-08-31 12:30:22 +08:00
yetone
104484f17c fix: use the original prompts (#397) 2024-08-30 22:21:50 +08:00
yetone
2997d4669a refactor: refactor planning prompts to resolve line number issues and indentation issues (#382) 2024-08-30 18:53:49 +08:00
Brent Yi
2c450b1da3 fix: AvanteEdit highlight for visual line mode (#326) 2024-08-28 11:46:26 -04:00
yetone
9dc00ecc10 fix: gemini (#323) 2024-08-28 22:17:00 +08:00
yetone
c54d2639f4 fix: spinner (#320) 2024-08-28 21:27:55 +08:00
yetone
b661269b5b fix: editing lines indentation (#317) 2024-08-28 20:18:32 +08:00
yetone
385522606c fix: indentation in first line (#311) 2024-08-28 16:26:08 +08:00
yetone
06f1d710bd fix: end_col out of range (#310) 2024-08-28 16:13:04 +08:00
Aaron Pham
2feaa28ced chore: cleanup typo and win options (#288)
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
2024-08-27 13:13:38 -04:00