8000 :bug: Fix ct.js saving projects' scripts with CRLF sequence instead o… · ct-js/ct-js@011b8b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 011b8b3

Browse files
🐛 Fix ct.js saving projects' scripts with CRLF sequence instead of LF, which caused them to be one-lined in the .ict file, making merging changes harder for Git users. You can fix the existing scripts by cutting and pasting their contents back.
1 parent 5950ffa commit 011b8b3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/node_requires/resources/projects/scripts.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ export const dropScriptModel = (script: Script) => {
88
};
99
/** This method is to be used when loading a project or creating a new script */
1010
export const addScriptModel = (script: Script) => {
11-
scriptModels.set(script, monaco.editor.createModel(
11+
const model = monaco.editor.createModel(
1212
script.code,
1313
'typescript'
14-
));
14+
);
15+
model.setEOL(monaco.editor.EndOfLineSequence.LF);
16+
scriptModels.set(script, model);
1517
};
1618
/** Resets the monaco file models and loads in all the script */
1719
export const loadScriptModels = (project: IProject) => {

0 commit comments

Comments
 (0)
0