Skip to content

Commit 8e7860d

Browse files
committed
add: should be able to remove those comments
1 parent 141c39d commit 8e7860d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/stats/StatsManager.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
getWordCount,
1111
getCitationCount,
1212
getFootnoteCount,
13+
cleanComments,
1314
} from "../utils/StatUtils";
1415

1516
export default class StatsManager {
@@ -108,6 +109,9 @@ export default class StatsManager {
108109
}
109110

110111
public async change(text: string) {
112+
if (this.plugin.settings.countComments) {
113+
text = cleanComments(text);
114+
}
111115
const fileName = this.workspace.getActiveFile().path;
112116
const currentWords = getWordCount(text);
113117
const currentCharacters = getCharacterCount(text);

src/status/StatusBar.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
getCitationCount,
88
getFootnoteCount,
99
getPageCount,
10+
cleanComments,
1011
} from "src/utils/StatUtils";
1112
import { debounce } from "obsidian";
1213

@@ -25,7 +26,7 @@ export default class StatusBar {
2526
);
2627

2728
this.statusBarEl.classList.add("mod-clickable");
28-
this.statusBarEl.setAttribute("aria-label", "Coming Soon");
29+
this.statusBarEl.setAttribute("aria-label", "!!!");
2930
this.statusBarEl.setAttribute("aria-label-position", "top");
3031
this.statusBarEl.addEventListener("click", (ev: MouseEvent) =>
3132
this.onClick(ev)
@@ -44,6 +45,10 @@ export default class StatusBar {
4445
const sb = this.plugin.settings.statusBar;
4546
let display = "";
4647

48+
if (!this.plugin.settings.countComments) {
49+
text = cleanComments(text);
50+
}
51+
4752
for (let i = 0; i < sb.length; i++) {
4853
const sbItem = sb[i];
4954

0 commit comments

Comments
 (0)