September 26, 2010 at 6:09 pm #9009
Yutaka Emura
Keymaster
Hello chjfth,
There is no easy way to do this, but I wrote this code for you:
if( document.selection.Find( "<(.+)>", eeFindReplaceRegExp | eeFindNext) ){
x1 = document.selection.GetTopPointX( eePosLogical );
y1 = document.selection.GetTopPointY( eePosLogical );
x2 = document.selection.GetBottomPointX( eePosLogical );
y2 = document.selection.GetBottomPointY( eePosLogical );
sLine1 = document.GetLine( y2 );
document.selection.Replace( "<(.+)>", "@1", eeFindReplaceRegExp);
sLine2 = document.GetLine( y2 );
x2 += sLine2.length - sLine1.length;
document.selection.SetActivePoint( eePosLogical, x1, y1 );
document.selection.SetActivePoint( eePosLogical, x2, y2, true );
}
I am sorry, but this code doesn’t support eeReplaceSelOnly flag. I still hope this helps.