roxma / vim-tmux-clipboard

seamless integration for vim and tmux's clipboard
MIT License
290 stars 24 forks source link

Initial line feed being trimmed during paste in neovim #4

Open erahhal opened 7 years ago

erahhal commented 7 years ago

Not sure whether tmux or neovim behavior changed, but one of them broke vim-tmux-clipboard when they were updated. When doing a multiple line selection then pasting, it will paste into the current line rather than the next line. I fixed it by changing the "autocmd TextYankPost" line to add another "\n" as the first parameter of the "join" call.

roxma commented 7 years ago

Unfortunately, tmux buffers (tmux list-buffer) cannot distinguish between characterwise text and linewise text (:help getregtype())

I don't know how to fix this behavior.

dgfitch commented 5 years ago

For what it's worth, this behavior currently breaks entirely inside neovim as well, with no tmux involved - simply doing yy on a line and then p pastes without the linefeed.

Looking at the code, I don't understand why that would be. If I figure it out, I'll send a PR.

rvega commented 4 years ago

The fix suggested by @erahhal works for me.