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

Feature request: Discarding visual selection #148

Open
sudoremo opened this issue Oct 30, 2017 · 6 comments
Open

Feature request: Discarding visual selection #148

sudoremo opened this issue Oct 30, 2017 · 6 comments
Labels
backlog This issue will be done later new feature

Comments

@sudoremo
Copy link

sudoremo commented Oct 30, 2017

First of all, thanks a bunch for vimagit - this may finally be the perfect solution for me so I don't need any GUI tools anymore!

Just one little thing: Am I right that it currently isn't possible to discard the changes using a visual selection? This would be a tremendous help. Thanks for considering this.

@sudoremo sudoremo changed the title Feature request Feature request: Discarding visual selection Oct 30, 2017
@jreybert
Copy link
Owner

Seems to be a pretty reasonable feature request.

You are right, it is not possible to discard a selection for now. Actually, in my flow, I stage everything I want, and then I discard the rest of a hunk. But your request fits perfectly in vimagit grammar.

If I may, this would made a perfect pull request: all the bricks are here to add this feature, you just have to put them together! If you don't want to, I will certainly implement it in the next few month.

PS: thanks for your kind message!

@sudoremo
Copy link
Author

Thanks for your quick response. I'm far from an expert in vimscript, but I can sure give it a try. Just to make sure: One could not discard individual characters, but just all of the lines "touched" by the visual selection. Is that correct?

And what key binding do you see fit for this visual mode command?

@jreybert
Copy link
Owner

Actually, it should almost work out of the box. My main concern is that visual selection is broken in next branch :/ (bad code coverage!...)

I fix that in branch next, and I look if it works.

jreybert added a commit that referenced this issue Oct 31, 2017
bug highlighted by issue #148

It shows that I must find another test framework than vader, which
allows feedkeys
jreybert added a commit that referenced this issue Oct 31, 2017
bug highlighted by issue #148

It shows that I must find another test framework than vader, which
allows feedkeys
jreybert added a commit that referenced this issue Oct 31, 2017
it does not work as is...

ref #148
@jreybert
Copy link
Owner

You can take a look to dev/discard_vselect branch: I plugged the bricks, but it fails to discard: magit#git#git_unapply does not work to discard a part of a hunk, it misses some git magic around here...

@kristijanhusak
Copy link

@jreybert I gave this a test with dev/discard_vselect branch, by visually selecting the line i want do discard, and doing DDD. I got this error:

error

@jreybert
Copy link
Owner

jreybert commented Apr 5, 2018

@kristijanhusak you are promoted to be the vimagit user of the month!

As I stated in october, the dev branch does not work as is. Thanks for the feedback. This should be a simple issue. I forgot it because I let a chance to @remofritzsche to make a PR (no problem @remofritzsche , there was no obligation to do the PR ;) ).

I will try to find some time to finish this feature.

@jreybert jreybert added the backlog This issue will be done later label Oct 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog This issue will be done later new feature
Projects
None yet
Development

No branches or pull requests

3 participants