Skip to content

Commit

Permalink
Adds support for Ctrl-/ block commenting (#2386)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Falleiro authored Dec 11, 2020
1 parent 563041e commit edbe40e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import 'codemirror/mode/javascript/javascript';
import 'codemirror/addon/edit/matchbrackets';
import 'codemirror/addon/lint/lint';
import 'codemirror/addon/selection/active-line';
import 'codemirror/addon/comment/comment';

import {EditorLocation} from '../records';
import bowser from '../services/bowser';
Expand Down Expand Up @@ -121,6 +122,7 @@ export default function Editor({
editor.setOption('extraKeys', {
[`${modifier}-I`]: onAutoFormat,
[`${modifier}-S`]: onSave,
[`${modifier}-/`]: cm => cm.toggleComment({indent: true}),
});
}, [onAutoFormat, onSave]);

Expand Down

0 comments on commit edbe40e

Please sign in to comment.