-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
free the cursor #7
base: master
Are you sure you want to change the base?
Conversation
oh hell yeah thanks man |
Source: <yacineMTB#7>
@@ -115,8 +110,7 @@ local function get_prompt(opts) | |||
if visual_lines then | |||
prompt = table.concat(visual_lines, '\n') | |||
if replace then | |||
vim.api.nvim_command 'normal! d' | |||
vim.api.nvim_command 'normal! k' | |||
vim.api.nvim_command 'normal! c' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep starting position cursor in original start line while replacing fix the fault in VISUAL LINE mode that keep moving starting cursor to wierd place
change vim.api.nvim_command 'normal! c'
to vim.api.nvim_command 'normal! c '
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
20241119_103006.mp4
Thanks to the original work in: <yacineMTB#7> The cursor wasn't truly free, as if you switch buffers the LLM response stream would error out from invalid extmark changes. Record the buffer ID and pass to data function handler for get extmark and set_text. This should allow for multiple requests to be running concurrently in separate buffers.
found a neat way to keep track of the position to stream tokens without forcing the user to keep the cursor in place
i implemented it in my own plugin (chottolabs/kznllm.nvim#9), but it might be useful here too
cursor is stuck:
dingllm_cursor_weird_.mov
cursor is free:
dingllm_cursor_fixed_.mov