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

Hit <CR> once to execute? #2

Open
kshenoy opened this issue Sep 14, 2014 · 3 comments
Open

Hit <CR> once to execute? #2

kshenoy opened this issue Sep 14, 2014 · 3 comments

Comments

@kshenoy
Copy link

kshenoy commented Sep 14, 2014

Hi, thank you for a really good plugin. I didn't think I needed it till I used it. Now it's almost indispensable.

I had a quick question about the behavior. When I execute :CtrlPCmdPalette<CR>, I type in my command and then I have to press <CR> twice to execute the command. This is a little different from opening files etc. where only a single <CR> is required. Is this behavior defined by this plugin or CtrlP itself?

Also, I understand that sometimes you wouldn't want to execute the command directly but maybe pass in some arguments etc. thus it makes sense to just put it on the command-line after pressing <CR>. However, is there a way I can define these mappings such that pressing <Tab> in the CtrlP window puts it on the command-line while pressing <CR> executes it?

@fisadev
Copy link
Owner

fisadev commented Sep 16, 2014

Sadly, CtrlP's extension API doesn't allow too much customization for the "choosing" of results. It only allows 4 modes of choosing, with <cr>, <c-t>, <c-v> or <c-x>, and each one has a special meaning.

That's why I used double to execute, and a single <cr> to just prepend and expect for extra arguments, as both seemed easier than something like control+key for one of the cases and for the other. Tab would be a nice one, but isn's supported in the extension API.

@kshenoy
Copy link
Author

kshenoy commented Sep 16, 2014

Ah, that sucks.

However, if you don't mind, could you elaborate on what exactly you'd need so that I can request the same here. This is supposed to be a fork that is active in accepting pull requests.

@fisadev
Copy link
Owner

fisadev commented Sep 17, 2014

If possible, it would be nice to be able to "accept" the selected result with other extension-defined keys (defined by each extension separatedly).
Example: an extension could be able to use TAB and CR as a keys to accept the selected result, with different behaviour for each key.

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