Viewing 1 post (of 1 total)
  • Author
    Posts
  • #9620
    Bill_Stewart
    Participant
    // gotoLongestLine.jsee
    if (document.selection.IsEmpty) {
    var begLine = 1;
    var endLine = document.GetLines();
    }
    else {
    var begLine = document.selection.GetTopPointY(eePosLogical);
    var endLine = document.selection.GetBottomPointY(eePosLogical);
    }

    var line = 0;
    var maxLen = 0;
    for (var n = begLine; n <= endLine; n++) {
    var len = document.GetLine(n).length;
    if (len > maxLen) {
    line = n;
    maxLen = len;
    }
    }

    if ((line > 0) && (maxLen> 0))
    document.selection.SetActivePoint(eePosLogical, maxLen + 1, line, false);
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.