/// Quote lines

//Options
var pQuote="> ";

var hMainWnd=AkelPad.GetMainWnd();
var pSelText;
var pResult;

if (hMainWnd)
{
  if (AkelPad.GetSelStart() == AkelPad.GetSelEnd())
    AkelPad.SetSel(0, -1);

  pSelText=AkelPad.GetSelText();
  pResult=pQuote + pSelText.replace(/\r/g, "\r" + pQuote);
  if (pSelText.charAt(pSelText.length - 1) == '\r')
    pResult=pResult.substr(0, pResult.length - pQuote.length)
  AkelPad.ReplaceSel(pResult, -1);
}