From f9e3f467a17facc72000a2239edf0471370d4618 Mon Sep 17 00:00:00 2001 From: Luke Leppan Date: Thu, 8 Jul 2021 22:54:59 +0200 Subject: [PATCH] fix syntax --- src/settings/settings-tab.ts | 42 ++++++++++++++++++++++++------------ src/status/parse.ts | 2 +- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/settings/settings-tab.ts b/src/settings/settings-tab.ts index 90bf772..c46f1ed 100644 --- a/src/settings/settings-tab.ts +++ b/src/settings/settings-tab.ts @@ -97,22 +97,36 @@ export class BetterWordCountSettingsTab extends PluginSettingTab { }); }); + this.containerEl.createEl("h3", { + text: "Syntax for the status bars works like this: ", + }); + + this.containerEl.createEl("li", { + text: "To get a stat input the name of the stat in between `{}` eg. `{word_count}`.", + }); + + this.containerEl.createEl("li", { + text: "All other words remain.", + }); + + this.containerEl.createEl("br"); + + this.containerEl.createEl("h4", { + text: "Available Stats:", + }); + this.containerEl.createEl("p", { text: - "Syntax for the status bars works like this: \n" + - "- To get a stat input the name of the stat in between `{}` eg. `{word_count}`.\n" + - "- All other words remain.\n\n" + - "Available Stats:\n" + - "- word_count\n" + - "- character_count\n" + - "- sentence_count\n" + - "- total_word_count\n" + - "- total_character_count\n" + - "- total_sentence_count\n" + - "- file_count\n" + - "- words_today\n" + - "- characters_today\n" + - "- sentences_today\n", + "word_count, " + + "character_count, " + + "sentence_count, " + + "total_word_count, " + + "total_character_count, " + + "total_sentence_count, " + + "file_count, " + + "words_today, " + + "characters_today, " + + "sentences_today, ", }); } } diff --git a/src/status/parse.ts b/src/status/parse.ts index 6e619c0..f21808f 100644 --- a/src/status/parse.ts +++ b/src/status/parse.ts @@ -43,7 +43,7 @@ export function parse(query: string): Expression { break; default: - parsed.push("{" + s + "}"); + parsed.push(s); break; } });