I would like to replace a multiline "rectangle" selection, with new text, 
separate text per line.

What I have done so far, is to create a string separated by the editors "eol".  
It was a guess, based on ::selectedText() returning a similar string when 
multiple selections exist.

But when calling ::replaceSelectedText, it drops the whole text at the last 
selection (the primary selection according to the docs)
Simple example:

Line [text 1]
Line [text 2]
Line [text 3]

Where the [] represent a 3 line multi-line selection.

int numSelections = SendScintilla( SCI_GETSELECTIONS );
QString txt
for( int ii = 0; ii < numSelections; ++ii )
    txt += QString("Line%1\r\n" ).arg( ii );
replaceSelectedText( txt );

I would like to have
Line [Line0]
Line [Line1]
Line [Line2]

What I get is
Line
Line
Line Line0
Line1
Line2

Any thoughts on how to implement this?

Scott
_______________________________________________
QScintilla mailing list
[email protected]
https://www.riverbankcomputing.com/mailman/listinfo/qscintilla

Reply via email to