Search code examples
pasteneovim

neovim ignores newline on paste


Using neovim version v0.8.2 when pasting multi-line text from the system clipboard (not an internal register), the newline characters get stripped away, undesirably resulting in a single line.

Querying the termpastefilter, the value is on the defaults - "BS,HT,ESC,DEL".

When pasting, neovim asks for a confirmation before pasting due to the fact there are control characters in the pasted string and in the confirmation message, part of the text is revealed with the control characters escaped, where one can clearly see the \n characters, however after pasting the string they get stripped.

The terminal emulator is urxvt version v9.31.

How can one undo this behavior?


Solution

  • I've the same "problem" but sad news:

    More information would be needed - what are "incorrect line endings" and have you disabled the confirm-paste plugin? If not, which option did you chose?

    Also for some reason when i open the terminal, half the screen is flushed. This seems to have been reported here already:

    Yes, that is a race condition between your wm and urxvt. It can happen with all terminals and also older versions of urxvt, but happens much more commonly in the current version. We have plans to address this, but are not sure what the right course is, yet, as it is not a bug.

    A workaround of sorts is to output some newliens so the prompt is at the bottom (which is where it will end up anyway, under normal use), or specify a geometry larger than the screen and let your wm shrink it, which has pretty much the same effect.

    Source is the official mailing list which can be found here: http://lists.schmorp.de/pipermail/rxvt-unicode/2023q1/002650.html

    As a workaround I will temporary transfer terminator.