Skip to content

Commit da87a89

Browse files
committed
Auto add trailing line because yes
1 parent 806ef8f commit da87a89

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

frontend/src/component/config/ConfigEditor.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ export function ConfigEditor(props: { guildID: string; plugin: string; }) {
2929
const save = async () => {
3030
setSaving(true);
3131

32+
const lastLine = view.state.doc.line(view.state.doc.lines).text;
33+
if (lastLine.length !== 0) {
34+
view.update([
35+
view.state.update({
36+
changes: { from: view.state.doc.length, insert: "\n" }
37+
})
38+
]);
39+
}
40+
3241
try {
3342
await writeGuildConfig(
3443
account()!.token,

0 commit comments

Comments
 (0)