<commit_before>settingWatcher: function(pref, func) {
	this.prefs = toolbar_buttons.interfaces.PrefService.getBranch(pref);
	this.prefs.QueryInterface(Components.interfaces.nsIPrefBranch2);
	this.pref = pref;
	this.func = func;

	this.startup = function() {
		this.prefs.addObserver("", this, false);
		var self = this;
		toolbar_buttons.registerCleanUpFunction(function() {
			self.prefs.removeObserver("", self);
		});
	};

	this.shutdown = function() {
		this.prefs.removeObserver("", this);
	};

	this.observe = function(subject, topic, data) {
		if (topic != "nsPref:changed") {
			return;
		}
		try {
			this.func(subject, topic, data);
		} catch(e) {} // button might not exist
	};
}<commit_msg>Fixed the pref watcher<commit_after>settingWatcher: function(pref, func) {
	this.prefs = toolbar_buttons.interfaces.PrefService.getBranch(pref);
	this.prefs.QueryInterface(Components.interfaces.nsIPrefBranch2);

	var observer = {
		observe: function(subject, topic, data) {
			if (topic != "nsPref:changed") {
				return;
			}
			try {
				func(subject, topic, data);
			} catch(e) {} // button might not exist
		}
	};

	this.startup = function() {
		this.prefs.addObserver("", observer, false);
		toolbar_buttons.registerCleanUpFunction(function() {
			self.prefs.removeObserver("", observer);
		});
	};

	this.shutdown = function() {
		this.prefs.removeObserver("", observer);
	};
}
{'fraction_non_alphanumeric': 0.15656565656565657, 'fraction_numerical': 0.001443001443001443, 'mean_word_length': 4.41796875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1640222', 'n_tokens_mistral': 510, 'n_tokens_neox': 469, 'n_words': 82}