Skip to content

Commit c5d3d12

Browse files
committed
fixed errors
1 parent 29503af commit c5d3d12

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

main.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,16 +269,14 @@ export default class OccuraPlugin extends Plugin {
269269
iconEl.empty();
270270
setIcon(iconEl, 'highlighter');
271271

272-
// Add appropriate icon
273272
if (this.settings.occuraPluginEnabled) {
274-
this.statusBarOccurrencesNumber = this.addStatusBarItem();
273+
// If we've never added the status bar item, do it now
274+
if (!this.statusBarOccurrencesNumber) {
275+
this.statusBarOccurrencesNumber = this.addStatusBarItem();
276+
}
275277
setTooltip(iconEl, 'Disable highlighting');
276278
iconEl.removeClass('is-disabled');
277279
} else {
278-
if (this.statusBarOccurrencesNumber) {
279-
this.statusBarOccurrencesNumber.remove();
280-
this.statusBarOccurrencesNumber = null;
281-
}
282280
setTooltip(iconEl, 'Enable highlighting');
283281
iconEl.addClass('is-disabled');
284282
}

src/settings.ts

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -144,31 +144,33 @@ export class OccuraPluginSettingTab extends PluginSettingTab {
144144
});
145145
});
146146

147-
new Setting(containerEl)
148-
.setName('Enable phrase highlighting')
149-
.setDesc('Allow multi-word phrases (e.g., "climate variability")')
150-
.addToggle(toggle => {
151-
toggle
152-
.setValue(this.plugin.settings.highlightPhrases)
153-
.onChange(async (value) => {
154-
this.plugin.settings.highlightPhrases = value;
155-
await this.plugin.saveSettings();
156-
this.plugin.updateEditors();
157-
});
158-
});
159-
160-
new Setting(containerEl)
161-
.setName('Case sensitive matching')
162-
.setDesc('Match only if the case is identical')
163-
.addToggle(toggle => {
164-
toggle
165-
.setValue(this.plugin.settings.caseSensitive)
166-
.onChange(async (value) => {
167-
this.plugin.settings.caseSensitive = value;
168-
await this.plugin.saveSettings();
169-
this.plugin.updateEditors();
170-
});
171-
});
147+
//for future feature
148+
// new Setting(containerEl)
149+
// .setName('Enable phrase highlighting')
150+
// .setDesc('Allow multi-word phrases (e.g., "climate variability")')
151+
// .addToggle(toggle => {
152+
// toggle
153+
// .setValue(this.plugin.settings.highlightPhrases)
154+
// .onChange(async (value) => {
155+
// this.plugin.settings.highlightPhrases = value;
156+
// await this.plugin.saveSettings();
157+
// this.plugin.updateEditors();
158+
// });
159+
// });
160+
161+
//for future feature
162+
// new Setting(containerEl)
163+
// .setName('Case sensitive matching')
164+
// .setDesc('Match only if the case is identical')
165+
// .addToggle(toggle => {
166+
// toggle
167+
// .setValue(this.plugin.settings.caseSensitive)
168+
// .onChange(async (value) => {
169+
// this.plugin.settings.caseSensitive = value;
170+
// await this.plugin.saveSettings();
171+
// this.plugin.updateEditors();
172+
// });
173+
// });
172174

173175
// Add a setting for adding new keywords
174176
new Setting(containerEl)

0 commit comments

Comments
 (0)