From 4b992e590887ad0f0e37251fc92befc10c3f3087 Mon Sep 17 00:00:00 2001 From: anekos Date: Wed, 7 Sep 2011 22:05:55 +0900 Subject: Currents から削除されないバグなおし --- my-style.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'my-style.js') diff --git a/my-style.js b/my-style.js index 722e93e..780edbc 100644 --- a/my-style.js +++ b/my-style.js @@ -240,6 +240,13 @@ EOM styles.addSheet(false, StyleNamePrefix + url, url, expand(css)); } + function unset (url, name) { + if (name) + url = url.slice(StyleNamePrefix.length); + delete Currents[url]; + styles.removeSheet(false, StyleNamePrefix + url); + } + const SubCommands = [ new Command( ['s[et]'], @@ -260,17 +267,17 @@ EOM 'Unset style', function (args) { let m = args[0]; - delete Currents[m]; if (m) { - styles.removeSheet(false, StyleNamePrefix + m); + unset(m); } else { for (let [, style] in Iterator(styles)) { if (style.name.indexOf(StyleNamePrefix) === 0) - styles.removeSheet(false, style.name); + unset(style.name, true); } } }, { + bang: true, literal: 1, completer: styleNameCompleter } -- cgit v1.2.3