⌃E
Move to end of line, or expand selection to end of line.

Script key: Move to end of line, or expand selection to end of line.

Posted by shirose_jp

Install

Details

Label ⌃E
Voice Over Move to end of line, or expand selection to end of line.
Script
// Move to end of line, or expand selection to end of line.
// カーソルを行末へ移動(行末まで選択)

var range = getSelectedRange();
var line_range = getSelectedLineRange();

var eol = line_range[0] + line_range[1];
if ( getTextInRange( eol - 1, 1 ) === '\n' ) {
  eol = eol - 1;
}

if ( isSelect() === true ) {
  setSelectedRange( range[0], eol - range[0] );
} else {
  setSelectedRange( eol, 0 );
}

function isSelect() {
  if ( getSelectedText().length > 0 ) {
    return true;
  } else {
    return false;
  }
}

Advanced

Keyboard shortcut None
Hide key Yes

Discussion

comments powered by Disqus