Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Shortcut for the custom function #23

Closed
serafxxx opened this issue Sep 5, 2018 · 8 comments
Closed

Shortcut for the custom function #23

serafxxx opened this issue Sep 5, 2018 · 8 comments

Comments

@serafxxx
Copy link

serafxxx commented Sep 5, 2018

I'm currently using SimpleMDE, but looks like its dead. Going to move to inscryb if it would be possible to assign shortcut to a custom function

@CWharton
Copy link
Contributor

CWharton commented Sep 6, 2018

This would be a great feature to have. You are more than welcome to submit a PR.

@working-name
Copy link

I'm looking for the same thing, but don't have the skill to code it myself, obviously, since I'm posting here instead of just making it happen.

@CWharton
Copy link
Contributor

CWharton commented Nov 1, 2018

@working-name, this project is open source and free to use to benefit everyone. I offer users of this software to do PR to implement features and to fix bugs to help this project evolve. You are not obligated by any means to contribute to this project in order to use it. Please understand that I am one person that works on several projects, have a full-time job, am a full-time parent, and working on a company startup. I do wish I could add all the features requested by other to this project but unfortunately, I do not have that kind of time. This is why I offer other to contribute what they can. If you are incapable or unwilling to contribute then please be forbearing and I will add this feature in the future unless someone commits a PR before I get the time.

@working-name
Copy link

I understand it's free as in free beer, I'm not trying to be an ass. I am also very grateful that you actually have continued working on a dead project. However, I have a sour taste in my mouth from other "open source" project managers where the de-facto response is "good luck".

I just took your "more than welcome to submit a PR" as "good luck", which is in line with other disinterested publishers. My mistake for pooling you together with the others.

Yes, you are right, I'm not at the point where I can figure it out, although I have been playing with it ever since I asked the other question about the toolbar buttons being completely replaced. If by some miracle I figure out how to get shortcuts for custom function names, I will definitely submit a PR.

@jonyhayama
Copy link
Contributor

The solution is quite simple. I tried to submit a PR but for some reason I couldn't push my changes...

Anyway, you can simply add

if( options.name && options.name in shortcuts ){
	bindings[options.name] = options.action;
}

right before return el; on the createIcon function. the line number is 125 if I'm not mistaken.

@working-name
Copy link

Nice, thanks!

jonyhayama added a commit to jonyhayama/inscryb-markdown-editor that referenced this issue Jan 14, 2019
@jonyhayama
Copy link
Contributor

Actually moved it to right before if (options.title && enableTooltips) { so the tooltip is properly generated.
Created a pull request, hope it helps :)

CWharton added a commit that referenced this issue Jan 17, 2019
@jonyhayama
Copy link
Contributor

@CWharton I believe we should close this issue... :)

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

No branches or pull requests

4 participants