mirror of
https://github.com/Kong/insomnia
synced 2024-11-07 22:30:15 +00:00
Don't auto-close brackets on one line editor (Fixes #1560)
This commit is contained in:
parent
60c623f0a4
commit
ec972b4694
@ -457,27 +457,28 @@ class CodeEditor extends React.Component {
|
||||
async _codemirrorSetOptions() {
|
||||
const {
|
||||
mode: rawMode,
|
||||
readOnly,
|
||||
hideLineNumbers,
|
||||
keyMap,
|
||||
lineWrapping,
|
||||
getRenderContext,
|
||||
autoCloseBrackets,
|
||||
dynamicHeight,
|
||||
getAutocompleteConstants,
|
||||
getRenderContext,
|
||||
hideGutters,
|
||||
tabIndex,
|
||||
placeholder,
|
||||
noMatchBrackets,
|
||||
noDragDrop,
|
||||
hideLineNumbers,
|
||||
hideScrollbars,
|
||||
noStyleActiveLine,
|
||||
noLint,
|
||||
hintOptions,
|
||||
indentSize,
|
||||
indentWithTabs,
|
||||
dynamicHeight,
|
||||
hintOptions,
|
||||
infoOptions,
|
||||
jumpOptions,
|
||||
keyMap,
|
||||
lineWrapping,
|
||||
lintOptions,
|
||||
noDragDrop,
|
||||
noLint,
|
||||
noMatchBrackets,
|
||||
noStyleActiveLine,
|
||||
placeholder,
|
||||
readOnly,
|
||||
tabIndex,
|
||||
} = this.props;
|
||||
|
||||
let mode;
|
||||
@ -548,6 +549,10 @@ class CodeEditor extends React.Component {
|
||||
options.lint = lintOptions;
|
||||
}
|
||||
|
||||
if (typeof autoCloseBrackets === 'boolean') {
|
||||
options.autoCloseBrackets = autoCloseBrackets;
|
||||
}
|
||||
|
||||
if (!hideGutters && options.lint) {
|
||||
// Don't really need this
|
||||
// options.gutters.push('CodeMirror-lint-markers');
|
||||
@ -975,6 +980,7 @@ CodeEditor.propTypes = {
|
||||
singleLine: PropTypes.bool,
|
||||
debounceMillis: PropTypes.number,
|
||||
dynamicHeight: PropTypes.bool,
|
||||
autoCloseBrackets: PropTypes.bool,
|
||||
hintOptions: PropTypes.object,
|
||||
lintOptions: PropTypes.object,
|
||||
infoOptions: PropTypes.object,
|
||||
|
@ -322,6 +322,7 @@ class OneLineEditor extends PureComponent {
|
||||
noStyleActiveLine
|
||||
noLint
|
||||
singleLine
|
||||
autoCloseBrackets={false}
|
||||
tabIndex={0}
|
||||
id={id}
|
||||
type={type}
|
||||
|
Loading…
Reference in New Issue
Block a user