以下の様な画像付きの補完だと、途中からどれを選択しているのかわからなくなってしまう。
どうにかしようとソースコードを読んでみた物の、各項目の高さは全く考慮していないようで、ちょっといじっただけでは無理臭い感じ。
どうしたものかな。
let (c = function (i) ({ text: 'hoge' + i, description: 'desc', thumbnail: 'http://a3.twimg.com/profile_images/68368809/devcat.jpg' })) commands.addUserCommand( ['test'], 'test for thumbailed completion', function () { /* DO NOTHING */ }, { completer: function (context) { context.keys = {text: "text", description: "description", thumbnail: "thumbnail"}; let process = Array.slice(context.process); context.process = [ process[0], function (item, text) (item.thumbnail ? <><img src={item.thumbnail} style="margin-right: 0.5em;"/>{text}</> : process[1].apply(this, arguments)) ]; context.completions = (''+Array(100)).split(',').map(function (_,i) c(i)); }, }, true );
修正案1
common/content/commandline.js:L1848 の
//this._getCompletion(index).scrollIntoView(false);
のコメントアウトを外す。
ただし、これを外すと以下の手順で妙な現象を起こせるようになる。
- :test
....... でスクロールするまで辿っていく - :a ここで補完リストの表示がおかしくなる。