hipstersmoothie / obsidian-plugin-toc

Create a tables of contents for a note.
286 stars 20 forks source link

Min and Max settings are not persisting #28

Open MarkWagner opened 1 year ago

MarkWagner commented 1 year ago

Min and Max settings are not persisting when making changes. I had to edit the data.json file.

jai-o commented 1 year ago

+1 same thing for me also

hipstersmoothie commented 1 year ago

PRs welcome!

x89cyber commented 1 year ago

This can be easily fixed by modifying main.js near line 249:


new import_obsidian2.Setting(containerEl).setName("Maximum Header Depth").setDesc("The highest header depth to add to the table of contents. Defaults to 6").addSlider((text) => text.setValue(this.plugin.settings.maximumDepth).setDynamicTooltip().setLimits(1, 6, 1).onChange((value) => {
  //this.plugin.settings.minimumDepth = value;
  this.plugin.settings.maximumDepth = value;
  this.plugin.saveData(this.plugin.settings);
}));
hipstersmoothie commented 1 year ago

Awesome! make a pr and it will be released quickly 🚀