Action Directory / Select Current Line(选择当前行)

Install

Select the current line closest to the cursor

Shared by

Script

// Select current line
// based on shirose_jp scripts (thanks!)

var line_range = editor.getSelectedLineRange();

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


editor.setSelectedRange( line_range[0], eol - line_range[0] );