mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: editor: always use LF as line ending
This commit is contained in:
1 parent
32bf5b9a7e
commit
c4521d9ce3
4 files changed
+10
-10
No files matched your search
@@ -143,7 +143,7 @@ export default class Editor extends DOMAttachedObject {
|
||||
});
|
||||
}
|
||||
this.editor.onDidChangeModelContent(() => {
|
||||
const val = this.editor.getValue();
|
||||
const val = this.editor.getValue({ lineEnding: '\n', preserveBOM: false });
|
||||
$dom.val(val);
|
||||
$dom.text(val);
|
||||
if (onChange) onChange(val);
|
||||
@@ -208,7 +208,7 @@ export default class Editor extends DOMAttachedObject {
|
||||
value(val?: string) {
|
||||
this.ensureValid();
|
||||
if (typeof val === 'string') return (this.editor || this.vditor).setValue(val);
|
||||
return (this.editor || this.vditor).getValue();
|
||||
return (this.editor || this.vditor).getValue({ lineEnding: '\n', preserveBOM: false });
|
||||
}
|
||||
|
||||
focus() {
|
||||
|
||||
Reference in new issue
Block a user