From 1a38e43b67807ceacc6b2decbf9496b902f80ec3 Mon Sep 17 00:00:00 2001 From: Lorem Ipsum Date: Wed, 16 Dec 2020 16:55:29 +0000 Subject: [PATCH] Change tab size --- assets/js/index.js | 7 +++-- index.html | 74 ++++++++++++++++++++++------------------------ 2 files changed, 40 insertions(+), 41 deletions(-) diff --git a/assets/js/index.js b/assets/js/index.js index c4dfea7..a45d264 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -15,7 +15,10 @@ window.onload = () => { foldGutter: true, gutters: ["CodeMirror-foldgutter", "CodeMirror-lint-markers"], matchBrackets: true, - lint: true + lint: true, + extraKeys: { + "Tab": cm => cm.replaceSelection(" ", "end") + } }); editor.focus(); @@ -63,14 +66,12 @@ window.onload = () => { dateArray = date.toLocaleString('en-US', { hour: 'numeric', hour12: true, minute: 'numeric' }), today = new Date(), yesterday = new Date(new Date().setDate(today.getDate() - 1)); - return today.toDateString() === date.toDateString() ? `Today at ${dateArray}` : yesterday.toDateString() === date.toDateString() ? `Yesterday at ${dateArray}` : `${String(date.getMonth() + 1).padStart(2, '0')}/${String(date.getDate()).padStart(2, '0')}/${date.getFullYear()}`; }, display = (el, data, displayType) => { if (data) el.innerHTML = data; el.style.display = displayType || "unset"; - }, hide = el => el.style.removeProperty('display'), regEscape = str => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), toObj = jsonString => JSON.parse(jsonString.replace(/\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g, (x, y) => y ? "" : x)), diff --git a/index.html b/index.html index 2675946..31bcf8c 100644 --- a/index.html +++ b/index.html @@ -32,63 +32,61 @@