//==================================================== // 見出し要素にジャンプ for 秀丸エディタ Ver.4.00 //---------------------------------------------------- escape; disabledraw; disableinvert; #cnt = 0; #x = x; #y = y; $ft = filetype; // 拡張子とDOCTYPE宣言の判定 if ( (".htm" == $ft) || (".html" == $ft) || (".shtml" == $ft) || (".xht" == $ft) || (".xhtml" == $ft) ) { gofileend; searchup ""; right; #selendx = x; #selendy = y; $openTag = gettext(#seltopx, #seltopy, x, y); // 現在の見出しレベルを得る #hLevel = val(midstr($openTag, 2, 1)); // 見出しの内容テキストを得る searchdown2 " -1) // タグ削除 $innerText = leftstr($innerText,strstr($innerText,"<")) + rightstr($innerText,strlen($innerText) - strstr($innerText,">")-1); while (strstr($innerText,"\n") > -1) // 行送り削除 $innerText = leftstr($innerText,strstr($innerText,"\n")) + rightstr($innerText,strlen($innerText) - strstr($innerText,"\n")-1); while (strstr($innerText,"\r") > -1) // 復帰削除 $innerText = leftstr($innerText,strstr($innerText,"\r")) + rightstr($innerText,strlen($innerText) - strstr($innerText,"\r")-1); while (strstr($innerText,"\t") > -1) // タブ削除 $innerText = leftstr($innerText,strstr($innerText,"\t")) + rightstr($innerText,strlen($innerText) - strstr($innerText,"\t")-1); // 見出しレベルごとのインデント $idt = leftstr("          ", (#hLevel*4)-4); if ($innerText == "") $innerText = "(missing...)"; $text[#cnt] = $idt+$innerText+" ("+str(#ln)+")"; #colm[#cnt] = #col; #line[#cnt] = #ln; #cnt = #cnt+1; searchdown $query,regular; } if (#cnt != 0) { mousemenuarray $text,#cnt; if (result == 0) { moveto #x,#y; endmacro; } movetolineno #colm[result-1],#line[result-1]; searchdown ""; right; #seltopx = x; #seltopy = y; searchup "<[hH][1-6]" ,regular; #selendx = x; #selendy = y; enabledraw y-windowheight/10; moveto #seltopx, #seltopy; beginsel; moveto #selendx, #selendy; endsel; } else { moveto #x,#y; message "見出し要素は見つかりませんでした。"; }