Conversation
There was a problem hiding this comment.
Hey, I'm sorry for a late review on this.
I've pointed out two main issues I see with the current code and I think it'd be trivial to fix these.
Also, I think we can safely use the selectionChanger function for headings like:
cm.replaceSelection(
selectionChanger(
cm.getSelection(), '### ', ''
)
);Thanks for the changes @mohan-mu.
index.js
Outdated
| // bold | ||
| 'Ctrl-B': function(cm) { | ||
| var selection = cm.getSelection(); | ||
| cm.replaceSelection('**' + selection + '**'); |
There was a problem hiding this comment.
This change takes away the existing functionality where you could use CTRL+B to toggle bold. This would always add more text. For example, pressing the hotkey twice on 'hello' would result in:
=> hello
=> **hello**
=> ****hello****
Arguably, the first approach wasn't foolproof either, but this implementation is immediately broken.
index.js
Outdated
| }, | ||
| // keyboard shortcut | ||
| 'Ctrl-L': function(cm) { | ||
| cm.replaceSelection(selectionChanger(cm.getSelection(), '<kbd>', '</kbd>')); |
There was a problem hiding this comment.
Your changes appear to change the code to be indented with 2 characters instead of 4, which is the current convention of the file. I'd appreciate if you could make sure the file remains consistent.
Hi Maintainers, I have added
KeyBindingsfor the below keys#71 ,#50
Ctrl-Alt-1: Heading 1Ctrl-Alt-2: Heading 2Ctrl-Alt-3: Heading 3Ctrl-Alt-4: Heading 4Ctrl-Alt-5: Heading 5Ctrl-Alt-6: Heading 6Shift-Ctrl-L: Links,Shift-Ctrl-I: Image,Shift-Ctrl-.: BlockQuoteShift-Ctrl-':CodeBlockShift-U: Unordered list,Shift-O:Ordered list,Please check it out
Thank You