You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(chat): add display.chat.window.pertab for tab-local chats
When enabled, chat buffers visible in another tab are not hidden when
opening or cycling chats in the current tab. Cycling via { / } is
scoped to chats that are either visible in the current tab or not
currently visible in any tab, so chats opened in other tabs are never
stolen.
The Toggle command jumps to the existing tab when the chat is open
elsewhere (with a notify) instead of moving the chat. The close keymap
prefers a chat that's already in or available to the current tab when
auto-opening a sibling chat after close. Chats survive tab closure and
fall back into the hidden pool, where they remain cycle-eligible from
any tab.
pertab is mutually exclusive with sticky; if both are enabled, the
sticky autocmd's callback no-ops (a warning is logged at setup) so
the chat does not follow tab switches under pertab semantics.
Includes the bufnr_available_to_current_tab helper to share the
hidden-or-current-tab availability check between cycling and the
close keymap, and extends registry.move with an optional filter so
the chat keymaps can scope cycling to current-tab + hidden entries
without changing CLI cycling behaviour.
Adds tests for:
- chat in another tab survives opening a new chat in the current tab
- close_last_chat skips chats visible in other tabs
- sticky+pertab logs a warning and chat does not follow tab switch
- closing a tab leaves its chat in the hidden pool with registry intact
@@ -6872,7 +6880,7 @@ response from the LLM, identifying the tool and duly executing it.
6872
6880
There are two types of tools that CodeCompanion can leverage:
6873
6881
6874
6882
1. **Command-based**: These tools can execute a series of commands in the background using `vim.system`. They're non-blocking, meaning you can carry out other activities in Neovim whilst they run. Useful for heavy/time-consuming tasks.
6875
-
2. **Function-based**: These tools, like insert_edit_into_file <https://github.com/olimorris/codecompanion.nvim/blob/main/lua/codecompanion/interactions/chat/tools/builtin/insert_edit_into_file.lua>, execute Lua functions directly in Neovim within the main process, one after another. They can also be executed asynchronously.
6883
+
2. **Function-based**: These tools, like insert_edit_into_file <https://github.com/olimorris/codecompanion.nvim/blob/main/lua/codecompanion/interactions/chat/tools/builtin/insert_edit_into_file/init.lua>, execute Lua functions directly in Neovim within the main process, one after another. They can also be executed asynchronously.
6876
6884
6877
6885
For the purposes of this section of the guide, we'll be building a simple
6878
6886
function-based calculator tool that an LLM can use to do basic maths.
Copy file name to clipboardExpand all lines: doc/usage/introduction.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,3 +28,5 @@ The `:CodeCompanionChat Toggle` command will automatically create a chat buffer
28
28
29
29
When in a chat buffer, you can cycle between other chat buffers with `{` or `}`.
30
30
31
+
By default, opening or cycling to a chat hides whichever chat is currently visible. If you'd rather keep chats per tab — so a chat opened in tab A is never closed or stolen by activity in tab B — set `display.chat.window.pertab = true` in your config. With that enabled, `{` / `}` only cycles through chats that are visible in the current tab or not currently visible anywhere, and `:CodeCompanionChat Toggle` jumps to the existing tab when the chat lives there.
0 commit comments