christoomey / vim-tmux-runner

Vim and tmux, sittin' in a tree...
MIT License
291 stars 37 forks source link

Sending multiple lines to pry with VtrSendLinesToRunner #104

Closed yuki-uthman closed 3 years ago

yuki-uthman commented 3 years ago

Such an amazing plugin chris!!!

One minor issue I'm having with pry in that when I visually select a couple of lines and send it to the tmux pane, this happens.

pry > [1,2,3].each do |number|
puts number
end
pry >   puts number
end
pry > end
1
2
3
=> [1, 2, 3]

I am using it with Neovim.

Thank you for the great plugin.

christoomey commented 3 years ago

Hi @yuki07yuki, thanks for the kind words! I'm assuming you're highlighting the extra "puts number; end" after the first pasted line. I think I'd just grown accustomed to it, but now that you highlight it, that is odd.

I've opened https://github.com/christoomey/vim-tmux-runner/pull/105 as a stab at resolving this and better handling the send-keys logic overall. I'm going to run with it locally for a bit to test things out, but if you're able to also test, that would be great. Hopefully I won't run into any issues and I'll be ok merging this in a few days.

yuki-uthman commented 3 years ago

Thanks for your reply!

I'm sorry I'm not sure if I understand what you mean and also I was not clear. I hope I m not using it incorrectly. I primarily followed your tmux and vim guide on thoughtbot. Amazing content!

So what I'm visually selecting is as follows

3.times do |i|
   puts i
end

and using VtrSendLinesToRunner to send to tmux

:'<,'>VtrSendLinesToRunner

And this is what I see in the pry output

pry > 3.times do |number|
puts number
end
pry >   puts number
end
pry > end
1
2
3
=> 3

If I send line by line it would produce

pry > 3.times do |number|
pry >   puts number
pry > end
1
2
3
=> 3

I did test your new commit but it did not work on my neovim.

The same command gave me

pry > 3.times do |i|puts i 
christoomey commented 3 years ago

I just pushed a new commit to the branch in that PR. Mind pulling that and testing again?

yuki-uthman commented 3 years ago

ok now everything works! Thank you!

christoomey commented 3 years ago

Great! Thanks for the report, and for testing out the fixes :)