CopilotC-Nvim / CopilotChat.nvim

Chat with GitHub Copilot in Neovim
https://copilotc-nvim.github.io/CopilotChat.nvim/
GNU General Public License v3.0
1.74k stars 84 forks source link

feat(chat): improve auto follow cursor behavior #497

Closed taketwo closed 2 days ago

taketwo commented 2 days ago

Auto follow cursor is generally a convenient and desirable feature. However, it gets annoying when the model is streaming a very long response spanning more vertical space than the chat window has. In such cases the user might want to read the response from the beginning at a human pace, yet auto follow keeps pushing forward at robot speed.

This PR improves auto follow cursor behavior by conditioning it on the current cursor position. If it is at the last line, auto-following happens. Otherwise, the cursor stays where it is. Effectively, this means that the user can prevent auto-following from happening by simply moving the cursor up.

deathbeam commented 2 days ago

@all-contributors add @taketwo for code

allcontributors[bot] commented 2 days ago

@deathbeam

I've put up a pull request to add @taketwo! :tada: