var x = parseInt(Editor.ExpandParameter("$x")); var y = parseInt(Editor.ExpandParameter("$y")); Editor.SelectAll(); var s = Editor.GetSelectedString(0); Editor.CancelMode(); var old = Editor.GetClipboard(0); Editor.SetClipboard(0, s); s = Editor.GetClipboardByFormat("CF_TEXT", 0, 1); Editor.SetClipboard(0, old); var arr = []; var pos = 0; var start = 0; while( pos < s.length ){ var code = s.charCodeAt(pos); if( code == 0x0a || code == 0x0d ){ if( pos + 1 < s.length && code == 0x0d || s.charCodeAt(pos + 1) == 0x0a ){ pos++; } arr[arr.length] = s.substring(start, pos + 1); start = pos + 1; } pos++; } if( start < s.length ){ arr[arr.length] = s.substring(start); } var targety = 0; for(; targety < arr.length; targety++ ){ if( Editor.GetLineStr(targety + 1) != arr[targety] ){ break; } } if( targety != arr.length ){ var findpos = 0; var targetline = Editor.GetLineStr(targety + 1); var sjisline = arr[targety]; for(; findpos < targetline.length; findpos++ ){ if( sjisline.length <= findpos ){ break; } if( targetline.charCodeAt(findpos) != sjisline.charCodeAt(findpos) ){ break; } } Editor.MoveCursor(targety + 1, findpos + 1, 0); Editor.InfoMsg( "SJIS以外の文字が見つかりました\n" + (targety + 1) + "," + (findpos + 1) ); }else{ Editor.MoveCursor(y, x, 0); }