nvim-code-action-menu icon indicating copy to clipboard operation
nvim-code-action-menu copied to clipboard

Error detected while processing CursorMoved Autocommands

Open IndianBoy42 opened this issue 3 years ago • 3 comments

E5108: Error executing lua ...ode_action_menu/lsp_objects/edits/text_document_edit.lua:93: attempt to get length of local 'last_original_complete_line' (a nil value)

This happens while running :CodeActionMenu on a use statement in a rust file. rust-analyzer returns a 'Unmerge use' code_action.

Also if I hit <ESC> to close the message bar, the popup still shows up (but with no diff)

IndianBoy42 avatar Oct 08 '21 01:10 IndianBoy42

Okay, I fixed the issue you found here. Unfortunately this brings me to the next issue: rust-analyzer sometimes reports many edits for the same line. Unfortunately I don't handle this correctly and preview the same line multiple times with different diffs. I need to rework my diff preview algorithm. In general it is not the best one. I don't think it makes sense to tweak this ugly beast here more and rather change it completely. Let me see. Do you have any suggestions for a better diff algorithm?

weilbith avatar Oct 08 '21 06:10 weilbith

I don't know much about different diff algorithms.

btw: I don't want to spam issues so maybe ill just report here that if you click off or otherwise make the cursor leave the virtual window then there doesn't seem to be a good way to go back and close the window. I think an autocmd on BufLeave or BufWinLeave that closes the window would be good

IndianBoy42 avatar Oct 08 '21 08:10 IndianBoy42

I can push a change to fix the issue for you. So it becomes at least somewhat usable again.

weilbith avatar Oct 08 '21 09:10 weilbith