Closed mikavilpas closed 1 week ago
hi @mikavilpas ,
So I've struggled with this issue in when I was working on it quite a bit, and also fiddled with it today, but I was not able to find a perfect solution 😢 .
Observations:
p
, p
means "paste below this line" so what is happening is technically correct. I could not find any combination of extmark gravity that would change that.P
, P
means "paste above this line" and that works because the input extmark gravity is left, only you get a newline after your linevp
or Vp
<--- this is now fixed by linked PRY
(you need to move to the start of the input, for example with 0
) and pasting with p
or P
works, same as your example.So in summary use approach from observation 3 or 4 above! Best we can do atm unless somebody else comes up with something better... Also, with the fix in observation (3), it technically behaves vim-like...
It's much better now! Thanks!
I wonder if it's possible for me to map p
to vP
in grug-far buffers only? If this "grug level solution" works then it would solve all my issues 😄
@mikavilpas I had another idea of how to address this today 😛
It's slightly hacky in it's implementation but it seems to work beautifully. Check latest, p
, P
and o
should just work ™️ !
When pasting with extra newline into an empty input it should smartly remove the newline.
It's really nice now 👍🏻
great! Thanks for confirming! I'll close the issue now but feel free to reopen if you see any problems 😄
Hi again! I have a habit of copying lines and pasting them with
yy
andp
. In the grug-far ui, it seems that pasting a line into the Replace section will actually paste it below it, causing a bit of hassle undoing the changes. Here's a demo:https://github.com/user-attachments/assets/d84010c5-3cd9-4a21-87db-fc2b8faaa131
In this demo, I copy the Search section and want to paste it, which causes the text to go into the Files Filter section. When I do it later in the clip, I use
y$
to leave out the trailing newline (I guess) - then it works.Would it be possible to improve this a bit? I try to do it smarter, but I am clearly not big brained enough 😄