Skip to content

Commit

Permalink
idk what im doing anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
kjloveless committed Nov 14, 2024
1 parent 70df5a6 commit c9c5df6
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c9c5df6

Please sign in to comment.