You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
so i stumbled on a problem with the input component when having multiline data... i had in my clipboard: "\ntext", so the first character is a newline. I got that by pasting something from discord.
I pasted that in the dressing input and the input showed "text" as if it was a single line. However when the callback is called, it receives "", so only the first line.
I think dressing should make some effort to return the line that it's displaying, which apparently may not necessarily be the first one.
Note that I could reproduce by selecting character-wise the text with the newline from neovim (v and move the cursor) before copying. If I copied line-wise (shift-v) then dressing did display an empty line after pasting.
System information
OS: linux
Neovim version: 0.9.1
Is this related to a specific vim.ui.select backend? If so, which one? no (it's input related)
Dressing config:
require('dressing').setup({
input= {
-- ESC won't close the modal, ability to use vim keysinsert_only=false,
get_config=function(opts)
ifopts.kind=='center_win' thenreturn {
relative='editor',
}
endend
},
select= {
get_config=function(opts)
-- https://github.com/stevearc/dressing.nvim/issues/22#issuecomment-1067211863-- for codeaction, we want null-ls to be last-- https://github.com/jose-elias-alvarez/null-ls.nvim/issues/630-- for eslint, it's offering me options like "disable eslint rule" which-- are almost never what I want, and they appear before the more useful options-- from the LSPifopts.kind=='codeaction' thenreturn {
telescope= {
sorter=require'telescope.sorters'.Sorter:new {
scoring_function=function(_, _, line)
localorder=tonumber(string.match(line, "^[%d]+"))
ifstring.find(line, escape_pattern('null-ls')) thenreturnorder+100elsereturnorderendend,
},
cache_picker=false,
-- copied from the telescope dropdown themesorting_strategy="ascending",
layout_strategy="center",
layout_config= {
preview_cutoff=1, -- Preview should always show (unless previewer = false)width=80,
height=15,
},
borderchars= {
prompt= { "─", "│", "", "│", "╭", "╮", "│", "│" },
results= { "─", "│", "─", "│", "├", "┤", "╯", "╰" },
preview= { "─", "│", "─", "│", "╭", "╮", "╯", "╰" },
},
}
}
endend,
},
})
To Reproduce
Steps to reproduce the behavior:
put in the clipboard [newline]text
open a dressing input dialog
paste
The text was updated successfully, but these errors were encountered:
To match the behavior of :help input(), I've updated it to only accept a single line of input. If you paste in a multiline string, it will now trim whitespace and remove trailing lines until there is only one line
Describe the bug
so i stumbled on a problem with the input component when having multiline data... i had in my clipboard:
"\ntext"
, so the first character is a newline. I got that by pasting something from discord.I pasted that in the dressing input and the input showed "text" as if it was a single line. However when the callback is called, it receives
""
, so only the first line.See:
https://github.com/stevearc/dressing.nvim/blob/master/lua/dressing/input.lua#L141
I think dressing should make some effort to return the line that it's displaying, which apparently may not necessarily be the first one.
Note that I could reproduce by selecting character-wise the text with the newline from neovim (v and move the cursor) before copying. If I copied line-wise (shift-v) then dressing did display an empty line after pasting.
System information
vim.ui.select
backend? If so, which one? no (it's input related)To Reproduce
Steps to reproduce the behavior:
[newline]text
The text was updated successfully, but these errors were encountered: