-
Notifications
You must be signed in to change notification settings - Fork 327
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
Add cmd+i and cmd+b for Mac users #1148
Comments
Currently I believe ctrl I and ctrl b already insert asterisks in the position. Is this not working for you? Keep the suggestions coming though! It's all good! |
The editor pane does already have keyboard shortcuts for bold and italics .. are these not working for you? |
Ah, ctrl does indeed work. However, on a Mac, that isn't "right". Control works, but for most using a Mac the expectation would be that Command would do the trick instead. Perhaps if both were functional? Also, this seems to be a one-way thing. It's not possible to un-asterisk bold or italics using the same hotkeys. It just doubles up. |
Ah I see. In that case, we can try to make both key combos work. That shouldn't be too hard. There also might be a way to undo italics, but I can see that getting complicated. For instance if you have this text and your cursor is at the X:
What happens when you hit ctrl-i? Does the word "some" get asterisks around it? Does a new set of asterisks appear in the middle of "some"? Do the outermost asterisks disappear? Not only do you have to parse all the nearby text for italics/not italics, but you have to count numbers of asterisks to make sure you don't mess up the bold on "bold". And that problem is a nightmare. Maybe possible, but probably rough. :/ |
Why not just add the asterisks where the highlight/selection starts and ends? If nothing is selected, including when the cursor is just inside a word, nothing happens. It should be relatively intuitive that the set of asterisks you need (depending on whether you choose italic or bold) appear at the start or end of a selection, even if it sort goofs up the format around other asterisks. In your example, nothing would happen, since the cursor hasn't highlighted anything. If you highlighted the word Some, and hit ctrl I, a set of single asterisks get added to either side of Some and it no longer becomes italicized, but leaves the rest italicized. |
So here's where we are at now:
So currently, ctrl-i does just that. It creates asterisks surrounding the current selected text. Now since the original designer hadn't thought about the case where nothing is selected, ctrl-i weirdly inserted I think this combination is pretty reasonable, and removing the no-select option after we so recently added it I think is going to confuse people. :/ I also like that it follows the other "snippet" behavior of inserting new code, where trying to "remove" a feature just requires extra logic.
This sounds simple in principle, but in reality it wouldn't work quite that easily. With the update to the markdown parser that will be part of v3, spacing for the asterisks becomes more strict. For example: Maybe as a future thing though. I'm not putting it completely off the table. Just not a priority for now. If you want to try your hand at a PR I'm all for it! |
I created a quick fiddle where the Ctrl+B/I shortcuts have the functionality of both adding and removing bold/italic if they are in the outmost part of the selection, but with Italics using You can check it here. There's also code for About Cmd key biddings, I can't help as I don't have a Mac. |
This has been fixed with #1191 |
If possible to update the editor to allow the use of common keyboard hotkeys to make formatting text faster, that would be awesome. Examples would be
ctrl/cmd + i
andctrl/cmd + b
to italicize and bold, respectively. And/Or something like the FancyPants editor on Reddit.Just throwing feature requests out there to see what sticks!
The text was updated successfully, but these errors were encountered: