rust-tools.nvim icon indicating copy to clipboard operation
rust-tools.nvim copied to clipboard

Bug: Newlines in Code Action title

Open tom-pollak opened this issue 3 years ago • 0 comments

Fixes issue putting new lines from a code action title in the code action box -- it does not accept newlines

Can be reproduced with :RustCodeAction on a hint that has a multiline title (e.g. "collapse nested if block:")

Error executing vim.schedule lua callback: ...opt/rust-tools.nvim/lua/rust-tools/code_action_group.lua:167: String cannot contain newlines                                               
stack traceback:                                                                                                                                                                         
        [C]: in function 'nvim_buf_set_lines'                                                                                                                                            
        ...opt/rust-tools.nvim/lua/rust-tools/code_action_group.lua:167: in function 'on_code_action_results'                                                                            
        ...opt/rust-tools.nvim/lua/rust-tools/code_action_group.lua:376: in function 'callback'                                                                                          
        ...Cellar/neovim/0.7.2_1/share/nvim/runtime/lua/vim/lsp.lua:1535: in function 'handler'                                                                                          
        ...Cellar/neovim/0.7.2_1/share/nvim/runtime/lua/vim/lsp.lua:1025: in function ''                                                                                                 
        vim/_editor.lua: in function <vim/_editor.lua:0>  

Fix puts title newlines on a new line of the code action box -- but any line after the first is not active. Also dosen't look very nice :)

tom-pollak avatar Oct 01 '22 00:10 tom-pollak