## 事象
[[results window (avante.nvim)|results window]]で `ESC` を押すと [[avante.nvim]] のサイドバーが意図せず閉じてしまう。
![[Pasted image 20250114225823.png|frame]]
*赤枠が results window*
### 環境
| 対象 | バージョン |
| --------------- | ------- |
| [[Neovim]] | 0.10.3 |
| [[avante.nvim]] | bd8afce |
## 原因
不明。バグ... もしくは制限事項 or 仕様かもしれない。
<div class="link-card-v2">
<div class="link-card-v2-site">
<img class="link-card-v2-site-icon" src="https://github.githubassets.com/favicons/favicon.svg" />
<span class="link-card-v2-site-name">GitHub</span>
</div>
<div class="link-card-v2-title">
bug: pressing ESC with focus on the Avante output windows closes the whole panel · Issue #917 · yetone/avante.nvim
</div>
<div class="link-card-v2-content">
Describe the bug When you cursor is set on the Avante output window pressing ESC or q will close whole panel. ...
</div>
<img class="link-card-v2-image" src="https://opengraph.githubassets.com/4f8705f0d1625fd30398bccb9f57fcd2198fa0adffd4d484a2de80d446ca1a63/yetone/avante.nvim/issues/917" />
<a href="https://github.com/yetone/avante.nvim/issues/917"></a>
</div>
## 回避策
[[autocmd (Neovim)]]で[[ウィンドウ (Vim)|ウィンドウ]]の[[ファイルタイプ (Vim)|ファイルタイプ]]が `Avante` のときに `<ESC>` のキーマップを削除する。
```lua
vim.api.nvim_create_autocmd('FileType', {
pattern = 'Avante',
callback = function()
vim.keymap.set({'n', 'o'}, '<ESC>', '<Nop>', { buffer = true })
end
})
```