diff --git a/packages/bruno-app/src/components/CodeEditor/index.js b/packages/bruno-app/src/components/CodeEditor/index.js index 2994b5448..aa0238ef0 100644 --- a/packages/bruno-app/src/components/CodeEditor/index.js +++ b/packages/bruno-app/src/components/CodeEditor/index.js @@ -190,32 +190,8 @@ export default class CodeEditor extends React.Component { 'Cmd-Y': 'foldAll', 'Ctrl-I': 'unfoldAll', 'Cmd-I': 'unfoldAll', - 'Cmd-/': (cm) => { - // comment/uncomment every selected line(s) - const selections = cm.listSelections(); - selections.forEach((range) => { - for (let i = range.from().line; i <= range.to().line; i++) { - const selectedLine = cm.getLine(i); - // if commented line, remove comment - if (selectedLine.trim().startsWith('//')) { - cm.replaceRange( - selectedLine.replace(/^(\s*)\/\/\s?/, '$1'), - { line: i, ch: 0 }, - { line: i, ch: selectedLine.length } - ); - continue; - } - // otherwise add comment - cm.replaceRange( - selectedLine.search(/\S|$/) >= TAB_SIZE - ? ' '.repeat(TAB_SIZE) + '// ' + selectedLine.trim() - : '// ' + selectedLine, - { line: i, ch: 0 }, - { line: i, ch: selectedLine.length } - ); - } - }); - } + 'Ctrl-/': 'toggleComment', + 'Cmd-/': 'toggleComment' }, foldOptions: { widget: (from, to) => {