Merge branch 'THeK3nger-master'

This commit is contained in:
Luke Leppan 2023-01-24 21:14:21 +02:00
commit 113c9ed172
No known key found for this signature in database
GPG key ID: D35B272CE58AE00A
4 changed files with 12 additions and 2 deletions

View file

@ -25,6 +25,10 @@ This plugin is the same as the built-in **Word Count** plugin, except when you s
- Added all word, char, sentence count when not viewing a markdown file.
- @lishid
- Helped solve the performace issue.
- @THeK3nger
- Fixed issue that occured when renaming files.
- @bakuzan
- Fixed issue that caused errors at start up.
### Special Thanks

View file

@ -1,7 +1,7 @@
{
"id": "better-word-count",
"name": "Better Word Count",
"version": "0.9.1",
"version": "0.9.2",
"description": "Counts the words of selected text in the editor.",
"author": "Luke Leppan",
"authorUrl": "https://lukeleppan.com",

View file

@ -1,6 +1,6 @@
{
"name": "better-word-count",
"version": "0.9.1",
"version": "0.9.2",
"description": "Counts the words of selected text in the editor.",
"main": "main.js",
"scripts": {

View file

@ -24,6 +24,12 @@ export default class StatsManager {
false
);
this.vault.on("rename", (new_name, old_path) => {
const content = this.vaultStats.modifiedFiles[old_path];
delete this.vaultStats.modifiedFiles[old_path];
this.vaultStats.modifiedFiles[new_name.path] = content;
});
this.vault.adapter.exists(STATS_FILE).then(async (exists) => {
if (!exists) {
const vaultSt: VaultStatistics = {