Skip to content

Commit ea7077a

Browse files
committed
Update filebrowser.js
1 parent eb60395 commit ea7077a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

filebrowser.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3201,7 +3201,14 @@ function setupEditor() {
32013201

32023202
// beautify
32033203
beautifierOptions.indent_char = cd.options.tab[0];
3204-
const beautifiedText = beautifyLang(selText, beautifierOptions);
3204+
let beautifiedText = beautifyLang(selText, beautifierOptions);
3205+
3206+
// prevent deleting ending newline when beautifying
3207+
if (selText.endsWith('\n') && !beautifiedText.endsWith('\n')) {
3208+
3209+
beautifiedText += '\n';
3210+
3211+
}
32053212

32063213
// compare current code with new code
32073214
// if the code is different, swap it

0 commit comments

Comments
 (0)