Oh, I just discovered that the methods are documented as blockBegin and
blockBegin but their actual names are setBlockBegin, setBlockEnd. You should fix
the documentation. Anyway a workaround I have found is to use something similar
to this:

function preserveSelection(NewText) {
  var ed = newEditor();
  ed.assignActiveEditor();

  // get start of current selection
  var bx = ed.blockBeginX();
  var by = ed.blockBeginY();

  / replace selected text
  ed.SelText(NewText);

  // select new text
  ed.setBlockBegin(bx,by);
  bx = ed.caretX();
  by = ed.caretY();
  ed.setBlockEnd(bx,by);
}

-- 
<http://forum.pspad.com/read.php?2,42233,42386>
PSPad freeware editor http://www.pspad.com

Odpovedet emailem