-
Notifications
You must be signed in to change notification settings - Fork 137
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
feat: actions.close
to clear pending motions before closing
#495
base: master
Are you sure you want to change the base?
feat: actions.close
to clear pending motions before closing
#495
Conversation
Hmmm...I would expect that this could be handled by setting the |
For Oil I've only got this:
But even though that is the case, if you do this:
Oil will remain open, but the mode gets changed back to Normal mode. You have to hit Escape again to close Oil. Which feels correct to me. If you do that again but press Ctrl + C instead of Escape in Step 3, then Oil is instantly closed although the mode was also changed back to Normal mode again. I use Ctrl + C a lot instead of Esc, so it may be a me problem. But in the context of an Oil buffer, it feels like Ctrl + C should behave like Escape. 🤔 |
@chrisbellboy I recently made some slight modifications to the default keymaps to put more of them as normal-mode-only. Can you check to see if you have any issues on the latest master? |
@stevearc Nice one, thanks! I just tested it, and it's really close but it's a bit buggy at the moment: The TL;DR is that Ctrl + C now only closes Oil if in normal mode (great). But it can require multiple With Oil open:
Similar for operator commands, with Oil open:
Thanks again for helping with this! |
That's odd, I'm not seeing that behavior. For example, if I do |
Added extra logic to ensure that
actions.close
doesn't close Oil if we're inoperator pending
orvisual
modes, instead it exits those modes with an<Esc>
call and returns early.This is to improve the UX as I can't be the only one who constantly accidentally closes Oil 😅 When all I wanted to do was clear an unfinished motion or get out of visual mode, but stay in Oil.
P.s. Long term Oil user, and loving life with it!