Next line

Script key: Next line

See also the companion Previous line key

Posted by agiletortoise

Install

Details

Label
Voice Over Next line
Script
// Move cursor down to next line

var text = getText();
var selRange = getSelectedRange();
var lnRange = getSelectedLineRange();

var pos = selRange[0];
var startDiff = selRange[0] - lnRange[0];
var flFirstFound = false;
var lnPos = 0;

while (pos < text.length) {
  if (text[pos] == '\n') {
    if (flFirstFound) {
      break;
    }
    else {
      flFirstFound = true;
    }
  }
  else {
    if (flFirstFound) {
      lnPos++;
    }
    if (lnPos > startDiff) {
      break;
    }
  }
  pos++;
}

//if (pLineStart < 0) { pLineStart = 0; }
setSelectedRange(pos,0);

Advanced

Keyboard shortcut None
Hide key Yes

Discussion

comments powered by Disqus