Skip to content

Commit

Permalink
Merge branch 'THeK3nger-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeleppan committed Jan 24, 2023
2 parents 9e6550f + 0ae4011 commit 113c9ed
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
6 changes: 6 additions & 0 deletions src/stats/StatsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 113c9ed

Please sign in to comment.