Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trim when substituting into not-linewise text object #60

Closed
chrisgrieser opened this issue Mar 4, 2023 · 5 comments
Closed

trim when substituting into not-linewise text object #60

chrisgrieser opened this issue Mar 4, 2023 · 5 comments
Labels
enhancement New feature or request
Milestone

Comments

@chrisgrieser
Copy link

chrisgrieser commented Mar 4, 2023

Take this example:

local foo = {
	"apple",
	"orange",
	"banana"
}
buySome(fruits)

I yank "banana" with yy, go two lines down, and want to substitute "fruits" via si).

-- result includes the leading whitespace
buySome(	"banana")

-- preferred result
buySome("banana")

This issue happens mostly when substituting a linewise register onto a characterwise text obejct. While the plugin is smart enough not to add the trailing line break, it does still insert the leading whitespace, which is slightly annoying. And I cannot think of any scenario where that would be desirable

@gbprod
Copy link
Owner

gbprod commented Mar 5, 2023

Hey!
I agree with you, I think we can do better for this use case. I'm thinking about something like the "Special puts" of yanky.
I should have time to work on this in the next weeks.

@gbprod gbprod added this to the v2 milestone Mar 21, 2023
@gbprod gbprod added the enhancement New feature or request label Mar 21, 2023
@gbprod
Copy link
Owner

gbprod commented Aug 21, 2023

This is not as easy to implements that I thought.
I did not forget about that but it will take longer than expected 😅

@gbprod
Copy link
Owner

gbprod commented Nov 14, 2023

Hey @chrisgrieser !
Sorry for the late answer 😅

I've almost finished a feature that could interest you here : #66.
I'm interested by some feedback about this if you have some time :)

Thanks

@gbprod
Copy link
Owner

gbprod commented Nov 16, 2023

Just merged it :)
But I still interested in your feedback :)

@gbprod gbprod closed this as completed Nov 16, 2023
@chrisgrieser
Copy link
Author

Thanks! I didn't have much time to look into this rn, but from the occasional usage it looks good to me? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants