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

Consider resetting bisect mode when the user stops changing direction. #14

Open
idbrii opened this issue Jan 21, 2014 · 5 comments
Open

Comments

@idbrii
Copy link

idbrii commented Jan 21, 2014

Requiring an additional keymap for BisectInsertStopBisect seems excessive. It would be nice if after I've pressed BisectNormalBisectUp and my cursor stopped moving (because there are no more lines to bisect) for the bisection to reset. That way I get one keypress with no movement to know that bisection is over. The next bisection keypress will restart from the beginning.

Alternatively, you could consider a system like vim-skip that uses your cursor's current position to determine where in the bisection you are.

@mikezackles
Copy link
Owner

Requiring an additional keymap for BisectInsertStopBisect seems excessive.

This is a fair point. I never use this functionality, and I didn't even realize it is exposed. Unless there's something I'm forgetting, I'll remove these bindings. You should never need to stop the current bisection before beginning a new one.

It would be nice if after I've pressed BisectNormalBisectUp and my cursor stopped moving (because there are no more lines to bisect) for the bisection to reset.

I've actually done this in the past, and I personally find it annoying. I prefer explicitly starting each bisection as it forces me to acknowledge that I made a mistake in the previous one. I'll look into making it a setting though.

Alternatively, you could consider a system like vim-skip that uses your cursor's current position to determine where in the bisection you are.

I think I've been leaning in this direction, so something like this could happen in the next version.

Thanks for your interest!

@mikezackles
Copy link
Owner

Sorry, I was mistaken -- I hadn't looked at this in a while. The StopBisect family of mappings is currently required. (I think of it as starting a new bisection instead of stopping the old one.) See above for my reasoning.

@idbrii
Copy link
Author

idbrii commented Jan 21, 2014

I threw together a simple bisection plugin that did what I thought I wanted: idbrii/vim-simplebisect@f78e799

Now I understand that you need StopBisect to support bisecting in two directions to get to your destination. (My dumb version only goes in one direction at a time.)


You could try use a highlight line to show the current bisection endpoints and if you bisect in another direction or don't move anymore (or Esc?) then it exits bisection and clears the highlighting.

You can highlight line 8 with something like this:

match CursorLine /\%8l/

Then the user has better visual feedback about when bisection is on or off and where they're bisecting.

I find vim-bisect hard to use because I feel like I'm stuck in a state if I keep bisecting in the same direction.

@mikezackles
Copy link
Owner

I'd like the highlight functionality as well.

I'm not saying the current interface is perfect, but I think the "getting stuck" issue becomes less of a problem once you get in the habit of calling StopBisect to start your bisections rather than stop them. Then you're never in a weird/unknown state.

I like your idea of a stateless version. I'm all for anything that reduces complexity.

@mikezackles
Copy link
Owner

See #19 regarding highlighting

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

No branches or pull requests

2 participants