- Extend AvanteSlashCommandType to include "commit"
- Add new command entry for "commit" with description "Commit the changes"
- Implement callback function for "commit" command
- Update input container logic to handle "commit" command
- Set request to "Please commit the changes" when "commit" command is used
Hanchin Hsieh <me@yuchanns.xyz>
This fixes a bunch of errors I was getting when switching away from the
avante sidebar and then back. Sometimes the sidebar would lose track of
the various windows, and you'd get errors like this:
```
|| stack traceback:
|| ...local/share/nvim/lazy/avante.nvim/lua/avante/sidebar.lua:2350: in function <...local/share/nvim/lazy/avante.nvim/lua/avante/sidebar.lua:2349>
|| Error detected while processing BufLeave Autocommands for "<buffer=294>":
|| Error executing lua callback: ...local/share/nvim/lazy/avante.nvim/lua/avante/sidebar.lua:2398: attempt to index field 'selected_files_container' (a nil value)
```
Or this one:
```
|| stack traceback:
|| ...local/share/nvim/lazy/avante.nvim/lua/avante/sidebar.lua:2350: in function <...local/share/nvim/lazy/avante.nvim/lua/avante/sidebar.lua:2349>
|| Error detected while processing BufLeave Autocommands for "<buffer=294>":
|| Error executing lua callback: ...local/share/nvim/lazy/avante.nvim/lua/avante/sidebar.lua:2398: attempt to index field 'selected_files_container' (a nil value)
```
This change does the following:
1. Proper order of cleanup in `reset()`
2. Proper cleanup in `create_selected_files_container()`
This fix is required for users with vim.o.virtualedit="all". Otherwise,
the cursor remains at the end of the prompt and has to be manually moved
back before entering the next prompt.
* Add helper function to check for dev icon availability
* Add function to display dev icon or nothing if icon plugins unavailable
* Fix existing use of icons
* Reformat with stylua