<div dir="ltr"><div class="gmail_extra"><br>2014-07-16 19:44 GMT+08:00 Huw Davies <<a href="mailto:huw@codeweavers.com" target="_blank">huw@codeweavers.com</a>>:<br>><br>> Yes.  So adding a special case to SetSelection should fix this.<br>



><br>> 'to' is already setup correctly to len+1, so the problem is<br>> adjusting cursors[0].  MoveCursorChars is clamping the<br>> cursor to len.<br>><br>> So you have two options, either alter MoveCursorChars<br>



> to allow it to move to len + 1. You'd need to retain the current<br>> behaviour in some circumstances though (such as moving<br>> to the right on right-arrow keys press), so you'd need to pass<br>> a flag or something.<br>



><br>> Option 2 is just the modify cursor[0] in SetSelection.  If this<br>> is the only place where one can select the final EOP, then<br>> this is probably the preferred solution.<br>><br>> Either way, you probably need to change the 'middle of<br>



> end paragraph run' fix up for cursor[0] at the end of<br>> SetSelection (probably by setting nOffset = run.len).<br>><br>> Having done this, check the tests still work (and the<br>> todos are fixed). Also play with wordpad for a while<br>



> to see it behaves correctly.<br>><br>> Does that make sense?<br><br>Thank you! </div><div class="gmail_extra">I will have a try.<br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Regards,<br>
</div><div>Jactry Zeng</div><div><br></div></div>
</div></div>