Bottom lines are missing when the ChatGPT window is full
It seems on my setup that the last lines in the ChatGPT window is missing when the window is full. As a result, you can't se the whole answer when the window is filled and you can't see your question either if you don't type some more so the texts moves "up into the window". I've tried to remove all my other plugins and commented out pretty much my whole init file and the issue remains.
It looks like not a problem with rendering but with request params, max number of tokens is set to 300 by default, try to increase it e.g.:
use({
"jackMort/ChatGPT.nvim",
config = function()
require("chatgpt").setup({
openai_params = {
max_tokens = 1000,
}
})
end,
requires = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim"
}
})
Thanks! I tried to change it, but no difference. I'm pretty sure the issue isn't with tokens. In this image, I can't see the last line: https://forumbilder.com/images/2022/12/15/2022-12-15-204306_1902x1030_scrot.png
However, when I ask a new question, the last lines seem to show up. https://forumbilder.com/images/2022/12/15/2022-12-15-204312_1902x1030_scrot.png
it seems to be that it isn't scrolling down to the bottom the ChatGPT window automatically so the bottom is visible. Maybe it's supposed to work that way? However, it's impossible to see if the last visible line actually is the end of the answer and I can't find any way to scroll inside the ChatGPT window. Maybe I'm missing something? They keybindings to scroll inside the telescope preview window doesn't work.
Oh I see, so it's a bug, I'll try to fix that but it may be hard because i cannot reproduce it on my setup. Do you see any errors in :messages?
Yeah, I think it's a bug or a misunderstanding on how it should work from my point.
:messages results in nothing. I was curious to see if there maybe was something wierd going on with my terminal and setup, so I booted a live image with Mint, installed nvim 8.1 from a debian package and installed only the required plugins with packer. The issue persists. I'm not sure if this link works, but I tried to upload to images here: https://imgur.com/a/4X0wYRp
What i've typed in the image is just "write a linked list in python" and "write a linked list in c". On this request, the last part of the text is missing. After typing "what is a linked list?" it shows the rest of the previous question, but not the last lines of the recent one.
Like I said, it may be possible that it's supposed to work this way, but if so it would be good with some kind of indication that there's more text "bellow" and a way to scroll down.
add: after finishing the text above, I tried again with the live image and noticed that it is possible to scroll inside the window using the mouse. Scrolling down makes the missing text visible. I can't however find a way to scroll using just the keyboard. The only solution i've found is pressing return, but since it's impossible to know where the end is it can result in sending an empty question (and it's still not possible to scroll up?).
Thanks for more information. I still cannot reproduce it, but I fixed the another layout bug meantime, and maybe that was the reason of this issue as well. Please try updating and checking again.
I have also added key mappings to scroll up <C-u> and down <C-d>.
Please let me know if the error still occurs and sorry for the inconvenience.
It doesn't seem to work. Trying to scroll results in
E5108: Error executing lua: ...site/pack/paqs/start/chatgpt.nvim/lua/chatgpt/module.lua:21: Error executing lua: ...site/pack/paqs/start/chatgpt.nvim/lua/chatgpt/module.lua:22: Vim(normal):E21: Cannot make changes, 'modifiable' is off
stack traceback:
[C]: in function 'cmd'
...site/pack/paqs/start/chatgpt.nvim/lua/chatgpt/module.lua:22: in function <...site/pack/paqs/start/chatgpt.nvim/lua/chatgpt/module.lua:21>
[C]: in function 'nvim_win_call'
...site/pack/paqs/start/chatgpt.nvim/lua/chatgpt/module.lua:21: in function 'scroll_chat'
...site/pack/paqs/start/chatgpt.nvim/lua/chatgpt/module.lua:70: in function <...site/pack/paqs/start/chatgpt.nvim/lua/chatgpt/module.lua:69>
stack traceback:
[C]: in function 'nvim_win_call'
...site/pack/paqs/start/chatgpt.nvim/lua/chatgpt/module.lua:21: in function 'scroll_chat'
...site/pack/paqs/start/chatgpt.nvim/lua/chatgpt/module.lua:70: in function <...site/pack/paqs/start/chatgpt.nvim/lua/chatgpt/module.lua:69>
May I ask you what OS you're using? Because here there's only two squares (and question marks after post) inside [[ ]] on local input = direction > 0 and [[]] or [[]]. Opening the file inside vim shows [[^E]] and [[^Y]] instead. I don't know lua at all, but it seems wrong? That are they supposed to check?
Edit: Worth noting is that if I press return on this error message, it does scroll up (or down). But everytime I try to scroll, the message appears.
at least in ChatGPT console <C-u> works fine but C-d produces Cannot add empty message