Skip to content

Commit

Permalink
yabli
Browse files Browse the repository at this point in the history
  • Loading branch information
najmiter authored Jan 27, 2024
1 parent ca7e04f commit 3b340a6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@ fetch("./settings.json")
.then((response) => response.json())
.then((settings) => (Settings = settings));

document.addEventListener("DOMContentLoaded", async () => {
document.addEventListener("DOMContentLoaded", () => {
// i forgot how to do it like a fire-emoji
// so i'm gonna do it like a sad-emoji
setTimeout(() => {
const n_spaces = +Settings.tab_size;

input_text.style.tabSize = n_spaces;
output_text.style.tabSize = n_spaces;

output_text.innerHTML = localStorage.getItem("styled_code") ?? "";
input_text.value = localStorage.getItem("plain_code") ?? "";
}, 100);

output_text.innerHTML = localStorage.getItem("styled_code") ?? "";
input_text.value = localStorage.getItem("plain_code") ?? "";
});

const is_space = (char) => char === " " || char === "\t";
Expand Down

0 comments on commit 3b340a6

Please sign in to comment.