Merge branch 'hotfix/0.7.5' into develop
This commit is contained in:
commit
3fef6659e3
4 changed files with 25 additions and 9 deletions
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "better-word-count",
|
"id": "better-word-count",
|
||||||
"name": "Better Word Count",
|
"name": "Better Word Count",
|
||||||
"version": "0.7.4",
|
"version": "0.7.5",
|
||||||
"description": "Counts the words of selected text in the editor.",
|
"description": "Counts the words of selected text in the editor.",
|
||||||
"author": "Luke Leppan",
|
"author": "Luke Leppan",
|
||||||
"authorUrl": "https://lukeleppan.com",
|
"authorUrl": "https://lukeleppan.com",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "better-word-count",
|
"name": "better-word-count",
|
||||||
"version": "0.7.4",
|
"version": "0.7.5",
|
||||||
"description": "Counts the words of selected text in the editor.",
|
"description": "Counts the words of selected text in the editor.",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -32,6 +32,12 @@ export interface TodayCounts {
|
||||||
sentences: number;
|
sentences: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface TotalCounts {
|
||||||
|
words: number;
|
||||||
|
characters: number;
|
||||||
|
sentences: number;
|
||||||
|
}
|
||||||
|
|
||||||
export class DataManager {
|
export class DataManager {
|
||||||
private vault: Vault;
|
private vault: Vault;
|
||||||
private metadataCache: MetadataCache;
|
private metadataCache: MetadataCache;
|
||||||
|
@ -171,6 +177,14 @@ export class DataManager {
|
||||||
return this.todayCounts;
|
return this.todayCounts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getTotalCounts(): TotalCounts {
|
||||||
|
return {
|
||||||
|
words: this.history[this.today].totalWords,
|
||||||
|
characters: this.history[this.today].totalCharacters,
|
||||||
|
sentences: this.history[this.today].totalSentences,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
async updateFromFile() {
|
async updateFromFile() {
|
||||||
this.history = Object.assign(
|
this.history = Object.assign(
|
||||||
JSON.parse(await this.vault.adapter.read(".vault-stats"))
|
JSON.parse(await this.vault.adapter.read(".vault-stats"))
|
||||||
|
|
|
@ -65,13 +65,13 @@ export class BarManager {
|
||||||
newText = newText + getSentenceCount(text);
|
newText = newText + getSentenceCount(text);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
newText = newText + this.dataManager.getTodayCounts().words;
|
newText = newText + this.dataManager.getTotalCounts().words;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
newText = newText + this.dataManager.getTodayCounts().characters;
|
newText = newText + this.dataManager.getTotalCounts().characters;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
newText = newText + this.dataManager.getTodayCounts().sentences;
|
newText = newText + this.dataManager.getTotalCounts().sentences;
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
newText = newText + this.dataCollector.getTotalFileCount();
|
newText = newText + this.dataCollector.getTotalFileCount();
|
||||||
|
@ -92,7 +92,7 @@ export class BarManager {
|
||||||
this.statusBar.displayText(newText);
|
this.statusBar.displayText(newText);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateAltStatusBar(): void {
|
async updateAltStatusBar(): Promise<void> {
|
||||||
let newText = "";
|
let newText = "";
|
||||||
const expression: Expression = parse(this.settings.statusBarAltQuery);
|
const expression: Expression = parse(this.settings.statusBarAltQuery);
|
||||||
if (this.settings.collectStats) {
|
if (this.settings.collectStats) {
|
||||||
|
@ -118,13 +118,15 @@ export class BarManager {
|
||||||
newText = newText + getSentenceCount("");
|
newText = newText + getSentenceCount("");
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
newText = newText + this.dataManager.getTodayCounts().words;
|
newText = newText + (await this.dataCollector.getTotalWordCount());
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
newText = newText + this.dataManager.getTodayCounts().characters;
|
newText =
|
||||||
|
newText + (await this.dataCollector.getTotalCharacterCount());
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
newText = newText + this.dataManager.getTodayCounts().sentences;
|
newText =
|
||||||
|
newText + (await this.dataCollector.getTotalSentenceCount());
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
newText = newText + this.dataCollector.getTotalFileCount();
|
newText = newText + this.dataCollector.getTotalFileCount();
|
||||||
|
|
Loading…
Reference in a new issue