// ϐ Grep (2011/09/19) $Word = "[@#$]*[_a-zA-Z0-9]+"; // $searchbuffer = searchbuffer; // #searchoption = searchoption; // #searchoption2 = searchoption2; call Main; // setsearch $searchbuffer, #searchoption, #searchoption2; endmacro; Main: if (!selecting) { disabledraw; call SearchUpLongest $Word; enabledraw; if (!##return) return; } $basetext = gettext(seltopx, seltopy, selendx, selendy, false); if ($basetext == "") { $srcptn = getsearchhist(0); } else { $srcptn = $basetext; } if (filename == "") { $filemask = "*.*"; } else if (filetype == ".htm" || filetype == ".html" || filetype == ".shtml") { $filemask = "*.htm;*.html;*.shtml"; } else if (filetype == ".js" || filetype == ".vbs" || filetype == ".wsf") { $filemask = "*.js;*.vbs;*.wsf"; } else { $filemask = "*" + filetype; } grep $srcptn, $filemask, directory2, word, casesense, subdir, icon, hilight; return; SearchUpLongest: ##ox = x; ##oy = y; right; searchup $$1, regular; if (!result) return false; while (result && (foundendy > ##dy || (foundendy == ##dy && foundendx >= ##dx))) { ##bx = foundtopx; ##by = foundtopy; ##dx = foundendx; ##dy = foundendy; findup; } if (##oy > ##dy || (##oy == ##dy && ##ox >= ##dx)) { escape; moveto ##ox, ##oy; return false; } moveto ##dx, ##dy; beginsel; moveto ##bx, ##by; endsel; return true;