move commentSelection command to other editing commands
This commit is contained in:
parent
6e8ff5b9ef
commit
2c86f2f4b9
|
@ -38,10 +38,6 @@
|
|||
|
||||
Object.assign(CodeMirror.defaults, defaults, prefs.get('editor.options'));
|
||||
|
||||
CodeMirror.commands.blockComment = cm => {
|
||||
cm.blockComment(cm.getCursor('from'), cm.getCursor('to'), {fullLines: false});
|
||||
};
|
||||
|
||||
// 'basic' keymap only has basic keys by design, so we skip it
|
||||
|
||||
const extraKeysCommands = {};
|
||||
|
@ -64,7 +60,7 @@
|
|||
// 'vim' and 'emacs' define their own autocomplete hotkeys
|
||||
}
|
||||
if (!extraKeysCommands.blockComment) {
|
||||
CodeMirror.keyMap.sublime['Shift-Ctrl-/'] = 'blockComment';
|
||||
CodeMirror.keyMap.sublime['Shift-Ctrl-/'] = 'commentSelection';
|
||||
}
|
||||
|
||||
if (navigator.appVersion.includes('Windows')) {
|
||||
|
|
|
@ -17,10 +17,15 @@ onDOMscriptReady('/codemirror.js').then(() => {
|
|||
toggleEditorFocus,
|
||||
jumpToLine,
|
||||
nextEditor, prevEditor,
|
||||
commentSelection,
|
||||
};
|
||||
// reroute handling to nearest editor when keypress resolves to one of these commands
|
||||
const REROUTED = new Set([
|
||||
...Object.keys(COMMANDS),
|
||||
'save',
|
||||
'toggleStyle',
|
||||
'jumpToLine',
|
||||
'nextEditor', 'prevEditor',
|
||||
'toggleEditorFocus',
|
||||
'find', 'findNext', 'findPrev', 'replace', 'replaceAll',
|
||||
'colorpicker',
|
||||
]);
|
||||
|
@ -199,6 +204,10 @@ onDOMscriptReady('/codemirror.js').then(() => {
|
|||
}, {value: cur.line + 1});
|
||||
}
|
||||
|
||||
function commentSelection(cm) {
|
||||
cm.blockComment(cm.getCursor('from'), cm.getCursor('to'), {fullLines: false});
|
||||
}
|
||||
|
||||
function toggleEditorFocus(cm) {
|
||||
if (!cm) return;
|
||||
if (cm.hasFocus()) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user