debian-mirror-gitlab/app/assets/javascripts/ide/lib/editor_options.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
942 B
JavaScript
Raw Normal View History

2023-03-04 22:38:38 +05:30
import { getCssVariable } from '~/lib/utils/css_utils';
2018-05-09 12:01:36 +05:30
export const defaultEditorOptions = {
model: null,
readOnly: false,
contextmenu: true,
scrollBeyondLastLine: false,
minimap: {
enabled: false,
},
wordWrap: 'on',
2021-04-29 21:17:54 +05:30
glyphMargin: true,
2022-07-23 23:45:48 +05:30
automaticLayout: true,
2023-04-23 21:23:45 +05:30
fontFamily: getCssVariable('--code-editor-font'),
2018-05-09 12:01:36 +05:30
};
2020-06-23 00:09:42 +05:30
export const defaultDiffOptions = {
ignoreWhitespace: false,
};
export const defaultDiffEditorOptions = {
...defaultEditorOptions,
quickSuggestions: false,
occurrencesHighlight: false,
ignoreTrimWhitespace: false,
readOnly: false,
renderLineHighlight: 'none',
hideCursorInOverviewRuler: true,
2021-04-29 21:17:54 +05:30
glyphMargin: true,
2020-06-23 00:09:42 +05:30
};
export const defaultModelOptions = {
insertFinalNewline: true,
trimTrailingWhitespace: false,
};
export const editorOptions = [
2018-05-09 12:01:36 +05:30
{
2021-03-08 18:12:59 +05:30
readOnly: (model) => Boolean(model.file.file_lock),
quickSuggestions: (model) => !(model.language === 'markdown'),
2018-05-09 12:01:36 +05:30
},
];