pappasam / nvim-repl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request? -> SendVisual does always send complete lines -> send only visual selection

viktmar opened this issue · comments

I love this plugin, thank you for providing it.

For some time now, I have lived with the fact, that selecting part of a line does send the complete line to the repl. Personally, I do often require this when debugging a function to evaluate the kwargs or to just check what a variable contains. Until now. I just make newlines before and after to get the job done. But maybe this wouldn't be to hard to implement?

Thanks in advance

I think I understand your question. Unless you can think of a very different way of managing this plugin, I think Vim currently has a limitation where Ex commands can only operate line-wise. I currently rely on a mapped Ex command, so supporting partial lines would require a creative refactoring. PR welcome, happy to consider adding this feature if someone can find a way to do it without introducing bugs!

:help visual-examples
7. Examples						*visual-examples*

							*:visual_example*
Currently the ":" command works on whole lines only.  When you select part of
a line, doing something like ":!date" will replace the whole line.  If you
want only part of the line to be replaced you will have to make a mapping for
it.  In a future release ":" may work on partial lines.

@viktmar ok, I figured it out! Resolved in the latest main

@pappasam Sorry, I was on a workshop since I wrote initially.
It works perfectly, thank you very much :)