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

Alias to sequences of commands #1

Open
luisdavim opened this issue Jul 9, 2016 · 8 comments
Open

Alias to sequences of commands #1

luisdavim opened this issue Jul 9, 2016 · 8 comments

Comments

@luisdavim
Copy link

Hi,

Would it be possible to have one alias to execute a sequence of commands?
For example, I have the following aliases:

aliasCommand 'w',
  orig: 'core:save'
aliasCommand 'q',
  orig: 'core:close'

and I would like to have:

aliasCommand 'wq',
  orig: 'core:save&core:close'

Thanks

@hurrymaplelad
Copy link
Owner

Sounds cool to me! PR welcome. I'd pass in the sequence of commands in an array, like:

aliasCommand 'wq',
  orig: ['core:save', 'core:close']

@luisdavim
Copy link
Author

Pull request created :)

@luisdavim
Copy link
Author

Hi,

Did you had a chance to take a look at my PR #3 ?
I've been using a version of the plugin with my changes and it does work as intended.
You can see some examples of how I've been using it here: https://github.com/luisdavim/dotfiles/blob/master/files/atom/init.coffee

Thanks

@hurrymaplelad
Copy link
Owner

Took a look just now, thanks for the PR! Add an example to the Readme and I'll get it merged.

@luisdavim
Copy link
Author

Thanks, Sure I'll add it
I'll add the test part if I'm able to figure it out.

Luis

@hurrymaplelad
Copy link
Owner

After digging a little deeper, looks like this direction is in conflict with Atom core's stance on composing commands.

Details here: #3 (comment)

I'd want to see a pretty compelling case before taking a different stance. Sorry for not surfacing the concern sooner...

@luisdavim
Copy link
Author

Thanks, Sure I'll add it
I'll add the test part if I'm able to figure it out.

Luis

@luisdavim
Copy link
Author

I've only seen your second comment now.
The solution I've implemented has been working for me for now. But you are right, this can result in flaky behaviour.

I'll make some investigation to check if I can translate existing commands back into API calls and then create the composited command the way described here.

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