diff options
author | anekos | 2010-05-31 04:49:23 +0000 |
---|---|---|
committer | anekos | 2010-05-31 04:49:23 +0000 |
commit | 3e819f2304dc616798fc0eebc7e3f18e9bc54239 (patch) | |
tree | ab004efc923edbc0ba17fdec24889060173ccd64 /gmail-commando.js | |
parent | 8e29222fe9aa75b989b7dbc861c80004dc3d9ece (diff) | |
download | vimperator-plugins-3e819f2304dc616798fc0eebc7e3f18e9bc54239.tar.bz2 |
補完改良
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37762 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'gmail-commando.js')
-rwxr-xr-x | gmail-commando.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/gmail-commando.js b/gmail-commando.js index 6f5180e..80fec50 100755 --- a/gmail-commando.js +++ b/gmail-commando.js @@ -39,7 +39,7 @@ let PLUGIN_INFO = <name lang="ja">GMail コマンドー</name> <description>The handy commands for GMail</description> <description lang="ja">便利なGMail用コマンドー</description> - <version>1.3.2</version> + <version>1.3.3</version> <author mail="anekos@snca.net" homepage="http://d.hatena.ne.jp/nokturnalmortum/">anekos</author> <license>new BSD License (Please read the source code comments of this plugin)</license> <license lang="ja">修正BSDライセンス (ソースコードのコメントを参照してください)</license> @@ -57,7 +57,7 @@ let PLUGIN_INFO = // INFO {{{ let INFO = <> - <plugin name="GMailCommando" version="1.3.2" + <plugin name="GMailCommando" version="1.3.3" href="http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/gmail-commando.js" summary="The handy commands for GMail" lang="en-US" @@ -72,7 +72,7 @@ let INFO = <description><p></p></description> </item> </plugin> - <plugin name="GMailコマンドー" version="1.3.2" + <plugin name="GMailコマンドー" version="1.3.3" href="http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/gmail-commando.js" summary="便利なGMail用コマンドー" lang="ja" @@ -305,14 +305,19 @@ let INFO = let input = args.string.slice(0, context.caret); let m; - if (m = /([\(\)\s]|^)([a-z]+):([^\s\(\)]*)$/(input)) { - context.advance(input.length - m[3].length); - let key = m[2]; + if (m = /([a-z]+):(?:([^\s\(\)\{\}]*)|[\(\{]([^\(\)\{\}]*))$/(input)) { + if (m[2]) { + context.advance(input.length - m[2].length); + } else { + let tail = /[^\s]*$/(m[3]); + context.advance(input.length - tail[0].length); + } + let key = m[1]; KeywordValueCompleter[key](context, args); return; } - if (m = /\s*([^\s:\(\)]*)$/(input)) { + if (m = /[-\s]*([^-\s:\(\)\{\}]*)$/(input)) { context.advance(input.length - m[1].length); context.completions = [ [v + ':', v] for ([, v] in Iterator(GMailSearchKeyword)) |