Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Problem disabling package #208

Closed
jsolisu opened this issue Nov 27, 2017 · 1 comment
Closed

Problem disabling package #208

jsolisu opened this issue Nov 27, 2017 · 1 comment
Labels

Comments

@jsolisu
Copy link

jsolisu commented Nov 27, 2017

When the package is disabled, the event subscription to ActivePaneItem is not unsubscribed.

// Hook into the events to recognize the user opening new editors or changing the pane
const activate = () => {
	generateConfig();
	showState();
	fixFile();
	atom.workspace.observeTextEditors(observeTextEditor);
	/* This subscription */ atom.workspace.observeActivePaneItem(observeActivePaneItem);
	reapplyEditorconfig();
};

// Clean the status-icon up, remove all embedded editorconfig-objects
const deactivate = () => {
	const textEditors = atom.workspace.getTextEditors();
	textEditors.forEach(editor => {
		editor.getBuffer().editorconfig.disposables.dispose();
	});
	statusTile.removeIcon();
};

Maybe the solution is to use a variable to receive the result of observeActivePaneItem and call dispose() to unsubscribe when package is disabled.

@florianb florianb added the bug label Nov 27, 2017
@florianb
Copy link
Collaborator

Thanks for reporting @jsolisu - the whole package is under a rewrite. If you can't wait this being fixed, i'd be happy to accept a PR! :)

@Alhadis Alhadis closed this as completed in 200d5ab Jul 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants