mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-09 06:55:03 +00:00
Added editor-keymap preference selection under Display/Code Editor
This commit is contained in:
@@ -13,6 +13,7 @@ import * as jsonlint from '@prantlf/jsonlint';
|
||||
import { JSHINT } from 'jshint';
|
||||
import stripJsonComments from 'strip-json-comments';
|
||||
import { getAllVariables } from 'utils/collections';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
let CodeMirror;
|
||||
const SERVER_RENDERED = typeof window === 'undefined' || global['PREVENT_CODEMIRROR_RENDER'] === true;
|
||||
@@ -117,7 +118,7 @@ if (!SERVER_RENDERED) {
|
||||
};
|
||||
}
|
||||
|
||||
export default class CodeEditor extends React.Component {
|
||||
class CodeEditor extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
@@ -142,7 +143,7 @@ export default class CodeEditor extends React.Component {
|
||||
lineWrapping: true,
|
||||
tabSize: TAB_SIZE,
|
||||
mode: this.props.mode || 'application/ld+json',
|
||||
keyMap: 'sublime',
|
||||
keyMap: this.props.editorPrefs?.keymap || 'sublime',
|
||||
autoCloseBrackets: true,
|
||||
matchBrackets: true,
|
||||
showCursorWhenSelecting: true,
|
||||
@@ -424,3 +425,7 @@ export default class CodeEditor extends React.Component {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const mapStateToProps = (state) => ({ editorPrefs: state.app?.preferences?.editor });
|
||||
|
||||
export default connect(mapStateToProps)(CodeEditor);
|
||||
|
||||
Reference in New Issue
Block a user