Closed emmanueltouzery closed 9 months ago
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