summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-11-21 17:25:30 +0700
committerShulhan <ms@kilabit.info>2023-11-21 17:25:30 +0700
commit0a16fffcf59a39ace4dda15de132ad9d261f5a66 (patch)
treefe4adbd8373db8f09005926374651d924f4f66c1
parentcdcd8b2d559bc367969aa531f32dd1f315d8b759 (diff)
downloadpakakeh.ts-0a16fffcf59a39ace4dda15de132ad9d261f5a66.tar.xz
editor: fix paste that always add new line
-rw-r--r--editor/editor.ts7
1 files changed, 2 insertions, 5 deletions
diff --git a/editor/editor.ts b/editor/editor.ts
index 1ea0438..dc58cd6 100644
--- a/editor/editor.ts
+++ b/editor/editor.ts
@@ -60,11 +60,8 @@ export class WuiEditor {
break;
}
- if (line == "\n") {
- content += line;
- } else {
- content += line + "\n";
- }
+ line = line.trimEnd();
+ content += line + "\n";
});
content = content.trim();