|
renderpanecommand もしくは browserpanecommand 特有だと思いますが、
・アクティブな秀丸プロセスではなく、非アクティブな秀丸プロセス
・renderpanecommand( { show:0 } ); を見えてるか確認せずに実行
以上が重なると、10〜20秒ほどで秀丸が操作不可能なほど崩壊するようです。
■再現率100%なので、マクロと手順を記載します。
・秀丸はタブモードとする。
・ver 9.46.05 β
おそらくは以前から。
■マクロ (test.mac)
hidemaruversion "9.46.05";
jsmode "JScript\\" + currentmacrofilename;
js {
var targetRenderPaneName = "HmImageInfo";
var timeoutHandler;
if (typeof(timeoutHandler) != "undefined") {
hidemaru.clearTimeout(timeoutHandler);
}
function deleteRenderPane() {
// if (isRenderPaneShow()) { // ★ この行コメントアウト外すと耐久力ある
// インスタンス削除
renderpanecommand({
target: targetRenderPaneName,
show: 0
});
// } // ★ この行コメントアウト外すと耐久力ある
}
function isRenderPaneShow() {
var isShow = renderpanecommand({
target: targetRenderPaneName,
get: "show"
});
console.log(isShow);
return isShow == "1";
}
var currentMacroDirectory = currentmacrodirectory();
// debuginfo(2);
function isNotOperateWindow() {
//return inputstates() & 0x00200000;
return inputstates() & 0x00000800
}
function execImageInfoProcess(filepath) {
return;
}
function tickImagePreview() {
// 自分は操作ウィンドウではない
if (isNotOperateWindow()) {
try {
deleteRenderPane();
console.log("isNotOperateWindow");
return;
} catch (e) {
} finally {
console.log("finally isNotOperateWindow");
timeoutHandler = hidemaru.setTimeout(tickImagePreview, 2000);
}
}
var selText = hidemaru.getSelectedText();
if (!selText) {
try {
deleteRenderPane();
console.log("isNotSelection");
return;
} catch (e) {
} finally {
console.log("finally isNotSelection");
timeoutHandler = hidemaru.setTimeout(tickImagePreview, 2000);
}
}
if (isRenderPaneShow()) {
try {
return;
console.log("isRenderPaneShow");
} catch (e) {
} finally {
console.log("finally isRenderPaneShow");
timeoutHandler = hidemaru.setTimeout(tickImagePreview, 2000);
}
}
try {
return;
} catch (e) {
} finally {
console.log("finally 最後");
timeoutHandler = hidemaru.setTimeout(tickImagePreview, 1000);
}
}
timeoutHandler = hidemaru.setTimeout(tickImagePreview, 0);
} // js
■再現手順
(0)タブモードのこと
(1)無題のファイルを作成。そのまま test.mac を実行
(2)再び別の無題のファイルを作成。そのまま test.mac を実行
(3)さらに別の無題のファイルを作成。そのまま test.mac を実行
それぞれの テキストエリアにて、適当に文字列を「aaaaaaaaa」や
漢字(IME)変換などいれていく。
10秒たたずして、
・いきなりフォーカスを失ったり、あるいは、
・全く別アプリにフォーカスがあるのに、いきなり秀丸がフォーカスを奪ったり、
・文字入力自体が困難になってくる。徐々に症状がひどくなる。
(4)しかしながら、「// ★ この行コメントアウト外すと耐久力ある」という
という2つの行のコメントアウトを外して、
```
if (isRenderPaneShow())
```
の判定を有効にすると、挙動が全く変わる。
完全に正しく動作するかは別として、
10秒ほどでいとも簡単に大崩壊といったことにはならなくなる。
|
|