diff options
author | anekos | 2011-09-07 22:05:55 +0900 |
---|---|---|
committer | anekos | 2011-09-07 22:05:55 +0900 |
commit | 4b992e590887ad0f0e37251fc92befc10c3f3087 (patch) | |
tree | 110c7d61803a00f957da9ba184df2048bc7589d5 /my-style.js | |
parent | 099644889e24d037facccdc1fe7e13b80bcc8b09 (diff) | |
download | vimperator-plugins-4b992e590887ad0f0e37251fc92befc10c3f3087.tar.bz2 |
Currents から削除されないバグなおし
Diffstat (limited to 'my-style.js')
-rw-r--r-- | my-style.js | 13 |
1 files changed, 10 insertions, 3 deletions
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 } |