diff options
author | anekos | 2010-05-31 12:36:53 +0000 |
---|---|---|
committer | anekos | 2010-05-31 12:36:53 +0000 |
commit | 44abce734ad67d22ee285973b32cf4fc92502a8e (patch) | |
tree | 18a16db903da3df4b12d116bb2615174758c6004 | |
parent | a22c37d2d3ec22a05f15cbe10146da044269818f (diff) | |
download | vimperator-plugins-44abce734ad67d22ee285973b32cf4fc92502a8e.tar.bz2 |
乾燥
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37771 d0d07461-0603-4401-acd4-de1884942a52
-rwxr-xr-x | gmail-commando.js | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/gmail-commando.js b/gmail-commando.js index 6d4a1f5..8ad2c64 100755 --- a/gmail-commando.js +++ b/gmail-commando.js @@ -296,6 +296,13 @@ let INFO = // sort はなんで破壊的なの!? const GMailSearchKeyword = 'label subject from to cc bcc has is in lang filename before after'.split(/\s/).sort(); + function simpleValueCompleter (values) { + return function (context) { + context.completions = [ + [v, v] for ([, v] in Iterator(values)) + ]; + }; + } const KeywordValueCompleter = { __noSuchMethod__: function () void 0, @@ -315,19 +322,9 @@ let INFO = ]; }, - is: function (context) { - const values = 'read unread starred chat voicemail muted sent'.split(/\s/).sort(); - context.completions = [ - [v, v] for ([, v] in Iterator(values)) - ]; - }, + is: simpleValueCompleter('read unread starred chat voicemail muted sent'.split(/\s/).sort()), - in: function (context) { - const values = 'anywhere inbox drafts spam trash'.split(/\s/).sort(); - context.completions = [ - [v, v] for ([, v] in Iterator(values)) - ]; - }, + in: simpleValueCompleter('anywhere inbox drafts spam trash'.split(/\s/).sort()), lang: function (context) { context.completions = [ |