Skip to content

Commit c585eaa

Browse files
committed
refactor
1 parent 598a2e6 commit c585eaa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

web_src/js/features/codeeditor.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export async function createMonaco(textarea, filename, editorOpts) {
121121

122122
// Monaco performs auto-detection of dominant EOL in the file, biased towards LF for
123123
// empty files. If there is an editorconfig value, override this detected value.
124-
if (eol) {
124+
if (eol in monaco.editor.EndOfLineSequence) {
125125
model.setEOL(monaco.editor.EndOfLineSequence[eol]);
126126
}
127127

@@ -199,7 +199,6 @@ function getEditorConfigOptions(ec) {
199199
opts.trimAutoWhitespace = ec.trim_trailing_whitespace === true;
200200
opts.insertSpaces = ec.indent_style === 'space';
201201
opts.useTabStops = ec.indent_style === 'tab';
202-
const eol = ec.end_of_line?.toUpperCase();
203-
opts.eol = ['LF', 'CRLF'].includes(eol) ? eol : undefined;
202+
opts.eol = ec.end_of_line?.toUpperCase();
204203
return opts;
205204
}

0 commit comments

Comments
 (0)