On Jan 27, 1:24 pm, "Edward K. Ream" <[email protected]> wrote:
> So there are only two choices: > > 1. There is something wrong with the following that is hidden in plain > sight: > > c = w.textCursor() > c.setPosition(i) > moveCount = abs(j-i) # can't be off-by-one, because it almost > always works. > c.movePosition(c.Right,c.KeepAnchor,moveCount) > w.setTextCursor(c) > > 2. There is a bug in c.movePosition. 2 is more likely. But now that we know what is happening, there is an easy workaround. The i,j args passed to w.delete(i,j) come from w.getSelectionRange, so we can always (or almost always) use w.textCursor().removeSelectedText() to delete the text. I expect this to work. Stay tuned. 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.
