On Tue, 2 Feb 2010 13:28:08 -0600 "Edward K. Ream" <[email protected]> wrote:
> On Tue, Feb 2, 2010 at 12:32 PM, Terry Brown <[email protected]> wrote: > > It seems the non-movePosition approach to create a selection would be > > > > setPosition(i, MoveMode=MoveAnchor); setPosition(j, MoveMode=KeepAnchor) > > Rev 2847 contains a modified version of qttexttest.py that > demonstrates the problem. It uses the code you suggest. No it doesn't. My suggestion would be with this diff: @@ -51,7 +51,8 @@ tc = w.textCursor() if n1 > n2: n1,n2 = n2,n1 tc.setPosition(n1) - tc.movePosition(tc.Right,tc.KeepAnchor,n2-n1) + # tc.movePosition(tc.Right,tc.KeepAnchor,n2-n1) + tc.setPosition(n2,tc.KeepAnchor) w.setTextCursor(tc) app.connect(w, Qt.SIGNAL("selectionChanged()"), showselect) which works. Not sure if that approach can be taken in the rest of the undo code though. I don't think movePosition can be used to construct selections, because it mimics the keyboard behavior, and so jumps two characters at times. Cheers -Terry > After > following the directions (select the text, hit do, then undo) one > extra character (the period) is selected. > > I'll file a bug report unless someone can tell me why this isn't a bug. > > Edward > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
