From c9c5df62480df6b4a4308bfe4ba9a5fafa352947 Mon Sep 17 00:00:00 2001 From: Kyle Loveless Date: Thu, 14 Nov 2024 10:45:14 -0600 Subject: [PATCH] idk what im doing anymore --- main.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/main.ts b/main.ts index 3f08fc7..bc7f80f 100644 --- a/main.ts +++ b/main.ts @@ -227,12 +227,7 @@ function editorOpen(filename: string) { console.log(`filename: ${filename}`); e.filename = filename; const data = Deno.readFileSync(filename); - // /\s+$/ - // \s+ -> matches one or more whitespace characters, including spaces, tabs, - // newlines, and carraige returns - // $ -> anchors the match to the end of the string - // '' -> replaces the matched whitespace chars with an empty string - const contents = decoder.decode(data).replace(/\s+$/, ""); + const contents = decoder.decode(data).trimEnd(); const lines = contents.split("\n"); let i = 0;