From 4fa3a50c6047cc7805278445773faf1c172b4be4 Mon Sep 17 00:00:00 2001 From: anekos Date: Wed, 29 Sep 2010 14:12:51 +0000 Subject: :memo! でコピー出来るようにした git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@38532 d0d07461-0603-4401-acd4-de1884942a52 --- memo.js | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) (limited to 'memo.js') diff --git a/memo.js b/memo.js index 25e588c..81750cc 100644 --- a/memo.js +++ b/memo.js @@ -38,13 +38,13 @@ let PLUGIN_INFO = {NAME} Write a memo to the specified file. 指定のファイルにメモを書く - 1.0.2 + 1.1.0 anekos new BSD License (Please read the source code comments of this plugin) 修正BSDライセンス (ソースコードのコメントを参照してください) http://coderepos.org/share/export/27234/lang/javascript/vimperator-plugins/trunk/memo.js 2.0pre - 2.3 + 2.4 ; gets().split(/\n/).reverse().forEach(function (l) { @@ -126,7 +129,37 @@ let PLUGIN_INFO = liberator.echo(out); } }, - {}, + { + bang: true, + literal: 0, + completer: function (context, args) { + if (!args.bang) + return; + + context.createRow = function(item, highlightGroup) { + let desc = item[1] || this.process[1].call(this, item, item.description); + + if (item.description && item.description.length) { + return
+
  • + {item.description} +
  • +
    ; + } + + return
    +
  • {item[0]} 
  • +
    ; + }; + context.filters = [function (item) this.match(item.description)]; + + context.completions = [ + [it.replace(/^[^\t]+\t/, ''), it] + for ([, it] in Iterator(gets().split(/\n/).reverse())) + if (it.length) + ]; + } + }, true ); -- cgit v1.2.3