var doc=App.ActiveDoc;

function Simple(){
	var pos=doc.CaretPos;
	doc.InsertAt(pos.Line, 0, ">");
}

if( !doc.HasSel() ){
	Simple();
}
else{
	var spos=doc.SelStartPos();
	var epos=doc.SelEndPos();
	if( spos.Line==epos.Line )
		Simple();
	else{
		spos.Col=0;
		epos.Col=10000000;
		var sel=doc.GetText(spos, epos, 2); //2 is unix style EOL
		sel = sel.replace(/^/gm, ">");
		doc.Delete(spos, epos);
		doc.Insert( sel );
		doc.SetSel(doc.CaretPos, spos);
	}
}