//検索文字列を「特に強調表示2」に加える
//あいまい検索は、強調表示にその扱いが無いので全ての option OFF の扱い
call GetLightChar;
$$hilightChar = $$return;
if(!hilightstate){
config "y+";
$$return = "";
}
else{
if(hilighttitle == "" || hilighttitle == "hilight0.tmp")
call HilightTitle;
else $$return = hilighttitle;
}
if( $$return == "" ){
if(hilighttitle != "hilight0.tmp")savehilight "hilight1.tmp";
$$return = "hilight1.tmp";
}
call MakeHilight $$return, $$hilightChar;
loadhilight "hilight0.tmp",0;
endmacro;
MakeHilight://DLL 無し版
##main = hidemaruhandle(0);
if($$1 == "")openfile "/h ";
else openfile "/h " + hidemarudir + "\\" + $$1,sjis;
showwindow 0;
gofileend;
insert $$2 + "\n";
saveas hidemarudir + "\\hilight0.tmp",sjis;
##highlight = hidemaruhandle(0);
setactivehidemaru ##main;
closehidemaru ##highlight;
return;
GetLightChar:
##option = 0;
$$string = searchbuffer;
if(searchoption&32){
##option = 8;
call TOUPPER $$string;
$$string = $$return;
}
else{
if(searchoption&1)##option = ##option|32;
if(searchoption&2 == 0)##option = ##option|8;
if(searchoption&16)##option = ##option|16;
if(searchoption&2 == 0 && searchoption&16 == 0){
call TOUPPER $$string;
$$string = $$return;
}
}
##option = ##option|67;
return str(##option) + "," + $$string;
GetType:
//「C言語ソースファイル」等と file type が決まっていない場合は "" を返す
openreg "CURRENTUSER", "Software\\Hidemaruo\\Hidemaru\\" + filetype;
if(result){
$$type=getregstr("");
closereg;
}
else $$type="";
return $$type;
HilightTitle:
if(filetype == "new" )
openreg "CURRENTUSER","Software\\Hidemaruo\\Hidemaru\\Default";
else if(filetype == "exeresult" || filetype == "grep")
openreg "CURRENTUSER","Software\\Hidemaruo\\Hidemaru\\" + filetype;
else{
call GetType;
if($$return == "")
openreg "CURRENTUSER","Software\\Hidemaruo\\Hidemaru\\Default";
else openreg "CURRENTUSER","Software\\Hidemaruo\\Hidemaru\\Config\\" + $$return;
}
$$HilightTitle = getregstr("HilightTitle");
closereg;
return $$HilightTitle;
TOUPPER://小文字を大文字に変換 (半角文字のみ)
##char=0x61;
while(##char<=0x7A){
call ChangeCharacter $$1,char(##char),char(##char-0x20);
$$1=$$return;
##char=##char+1;
}
return $$1;
ChangeCharacter://buff 中の文字列を置換
//$$1:buff
//$$2:検索文字列
//$$3:置換文字列
##change_char=strlen($$2);
$$string = "";
while(1){
##number = strstr($$1, $$2);
if(##number == -1)break;
else{
##long = strlen($$1);
$$string = $$string + leftstr($$1, ##number) + $$3;
$$1 = rightstr($$1, ##long - ##number - ##change_char);
}
}
return $$string + $$1;
|