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

Enable sublime keymap from CodeMirror #2379

Closed

Conversation

thayerve
Copy link

@thayerve thayerve commented Sep 2, 2020

@paulproteus and I found that the commenting function called by Cmd-/ is one of several keyboard shortcuts included with the 'sublime' keymap of CodeMirror, so this commit just enables that whole shebang documented here: https://codemirror.net/demo/sublime.html

Also imports the Comment addon from CodeMirror because it's called in the keymap to toggle comment.

Caveat: This may not include Windows-friendly commands, as the cmd button is specified in the keymap.

Close #2276

@outoftime
Copy link
Contributor

@thayerve thanks for this! I guess I’m not totally convinced that we would want to enable the entire Sublime keymap, can you elaborate on your thinking here? In particular:

  • I would not expect many students who use Popcode to be familiar with Sublime and its keybindings; generally use of an editor like Sublime would come later in the student’s development as a coder
  • A good number of the bindings in the sublime keymap seem to relate to functionality that we don’t have enabled for Popcode, e.g. code folding, bookmarks, marks, etc.

So my overall concern is that we’re pulling in a lot of keybindings that won’t work at all, and a lot more that will work but that probably no student will ever use. The main practical downside of this approach is that the intent isn’t clear (looking at the code, you’d have no way of knowing that what we are actually trying to accomplish is the addition of a multiline comment keyboard shortcut). If there’s a convincing case that there are a substantial number of other shortcuts that students in the bundle that students will find practically useful, I’m definitely open to it; I just don’t see much on a scan of the key binding list.

Let me know your thoughts!

@outoftime
Copy link
Contributor

Superseded by #2386

@outoftime outoftime closed this Dec 17, 2020
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

Successfully merging this pull request may close these issues.

Toggle multiline comments in editor with cmd-/
2 participants