sometimes I need a function like 'goto longest line'.
Actually (in UE 14.20) I try to find them by scrolling down with the page down key
Can I find them with a regular expression or is there a function built in?
Thanks, jrs
Welcome to the IDM Forum. This forum is meant as a user-to-user support mechanism where users can share knowledge and tips for all IDM software.
Since these forums are user-to-user based, IDM does not regularly read or reply to the posts in this forum. For problem reports, suggestions, or feature requests, you must email us directly. Our trained technical support staff answers most inquiries within 30 minutes.
// This script sets the cursor to start of the first line in the active
// document with the greatest number of characters. If the file does not
// contain tabs, this line is also the first line of the longest lines
// or the longest line if there is no further line with the same number
// of characters.
if (UltraEdit.document.length > 0) {
var nChars = 0;
var nFound = 0;
var nLine = 0;
var nStep = 1000;
UltraEdit.perlReOn();
UltraEdit.activeDocument.hexOff();
UltraEdit.activeDocument.findReplace.searchDown=true;
UltraEdit.activeDocument.findReplace.searchInColumn=false;
UltraEdit.activeDocument.findReplace.mode=0;
UltraEdit.activeDocument.findReplace.matchCase=false;
UltraEdit.activeDocument.findReplace.matchWord=false;
UltraEdit.activeDocument.findReplace.regExp=true;
do {
nFound = nChars;
nChars += nStep;
UltraEdit.activeDocument.top();
if (UltraEdit.activeDocument.findReplace.find("^.{"+nChars+",}")) {
nLine = UltraEdit.activeDocument.currentLineNum;
} else {
if (nStep == 1) break;
nStep /= 10;
nChars = nFound;
}
} while (nChars < 20000);
UltraEdit.activeDocument.gotoLine(nLine,1);
}
// This script sets the cursor to start of the first line in the active
// document with the greatest number of characters. If the file does not
// contain tabs, this line is also the first line of the longest lines
// or the longest line if there is no further line with the same number
// of characters.
if (UltraEdit.document.length > 0) {
var nChars = 0;
var nFound = 0;
var nLine = 1;
var nStep = 1000;
UltraEdit.perlReOn();
UltraEdit.activeDocument.hexOff();
UltraEdit.activeDocument.findReplace.searchDown=true;
UltraEdit.activeDocument.findReplace.searchInColumn=false;
UltraEdit.activeDocument.findReplace.mode=0;
UltraEdit.activeDocument.findReplace.matchCase=false;
UltraEdit.activeDocument.findReplace.matchWord=false;
UltraEdit.activeDocument.findReplace.regExp=true;
do {
nFound = nChars;
nChars += nStep;
UltraEdit.activeDocument.gotoLine(nLine,1);
if (UltraEdit.activeDocument.findReplace.find("^.{"+nChars+",}")) {
nLine = UltraEdit.activeDocument.currentLineNum;
} else {
if (nStep == 1) break;
nStep /= 10;
nChars = nFound;
}
} while (nChars < 20000);
}
//Modification:
var nLine = UltraEdit.activeDocument.currentLineNum+1;