2008-10-16現時点のパッチ
開発版のCVS headがあまりにクソなので最近パッチばかり書いている気がする。コミッタは最低限の動作確認をすてからコミットするべきだろ、JK
vimp.20081016T0717.patch
Index: hints.js =================================================================== RCS file: /cvs/vimperator/src/content/hints.js,v retrieving revision 1.90 diff -u -r1.90 hints.js --- hints.js 14 Oct 2008 08:05:29 -0000 1.90 +++ hints.js 15 Oct 2008 22:11:14 -0000 @@ -535,7 +535,7 @@ case "contains" : return containsMatcher(hintString); case "wordstartswith": return wordStartsWithMatcher(hintString, /*allowWordOverleaping=*/ true); case "firstletters" : return wordStartsWithMatcher(hintString, /*allowWordOverleaping=*/ false); - case "custom" : return plugins.customHintMatcher(hintString); + case "custom" : return liberator.plugins.customHintMatcher(hintString); default : liberator.echoerr("Invalid hintmatching type: " + hintMatching); } return null; Index: liberator.js =================================================================== RCS file: /cvs/vimperator/src/content/liberator.js,v retrieving revision 1.136 diff -u -r1.136 liberator.js --- liberator.js 15 Oct 2008 19:06:18 -0000 1.136 +++ liberator.js 15 Oct 2008 22:11:16 -0000 @@ -920,12 +920,12 @@ let files = io.readDirectory(dir.path, true); files.forEach(function (file) { - if (!file.isDirectory() && /\.(js|vimp)$/i.test(file.path) && !(file.path in pluginFiles)) + if (!file.isDirectory() && /\.(js|vimp)$/i.test(file.path) && !(file.path in liberator.pluginFiles)) { try { io.source(file.path, false); - pluginFiles[file.path] = true; + liberator.pluginFiles[file.path] = true; } catch (e) {}; } Index: mappings.js =================================================================== RCS file: /cvs/vimperator/src/content/mappings.js,v retrieving revision 1.134 diff -u -r1.134 mappings.js --- mappings.js 15 Oct 2008 02:09:05 -0000 1.134 +++ mappings.js 15 Oct 2008 22:11:16 -0000 @@ -218,7 +218,7 @@ commands.add([ch + "no[remap]"], "Map a key sequence without remapping keys" + modeDescription, - function (args) { map(args, modes, true); }); + function (args) { map(args, modes, true); }, opts); commands.add([ch + "mapc[lear]"], "Remove all mappings" + modeDescription, Index: options.js =================================================================== RCS file: /cvs/vimperator/src/content/options.js,v retrieving revision 1.140 diff -u -r1.140 options.js --- options.js 15 Oct 2008 20:48:34 -0000 1.140 +++ options.js 15 Oct 2008 22:11:17 -0000 @@ -284,7 +284,7 @@ var str = <table> { - template.map(globalVariables, function ([i, value]) { + template.map(liberator.globalVariables, function ([i, value]) { let prefix = typeof value == "number" ? "#" : typeof value == "function" ? "*" : " "; @@ -326,7 +326,7 @@ if (!reference[0]) { if (reference[2] == "g") - reference[0] = globalVariables; + reference[0] = liberator.globalVariables; else return; // for now }
最近の動向として、名前空間の変更が大きい。
liberator.modules
オブジェクトが追加- このオブジェクトをスコープとして下記ファイルが読み込まれる
- commands.js
- options.js
- mappings.js
- buffer.js
- events.js
- ui.js
- editor.js
- io.js
- util.js
- プラグインもこのオブジェクトが基本スコープ
- このオブジェクトをスコープとして下記ファイルが読み込まれる
js
,echo
等のコマンドのスコープはliberator
のまま
つまり、
liberator.commands.addUserCommand
liberator.mappings.addUserMap
は使用できなくなっていて、代わりに
liberator.modules.commands.addUserCommand
orcommands.addUserCommand
liberator.modules.mappings.addUserMap
ormappings.addUserMap
を使用しないといけない。
旧バージョンとの互換性を維持するなら後者の方が良いだろう。
ただし、liberator.globalVariables
やliberator.plugins
,liberator.echo
,liberator.NEW_TAB
などはそのまま。下手にliberator
を省略すると最新版で動かないことになる。
プラグイン作成者/メンテナは注意されたし。
過去の傾向から仕様が元に戻るということは無かったと思うので、この変更が修正される事は無いと思う。
まぁ過去を気にせずガンガン変更が加わるのは、下手に互換性維持のためにゴチャゴチャしてくるよりは良いことだと思う....。事前に変更が加わることのアナウンスが欲しいなとは思うけど。