#298 SCI_SCROLLCARET does not work with word wrap

Bug
closed-works-for-me
Scintilla (796)
4
2005-06-04
2005-05-23
No

After setting wrod wrapping to SC_WRAP_WORD and
inserting enough text to go past the end of the windows
I am trying to move the caret to the end of the text
and then scroll it into view:

int nLastLine = SendMessage(SCI_GETLINECOUNT) - 1;
int nLastPos = SendMessage(SCI_GETLINEENDPOSITION,
nLastLine);
SendMessage(SCI_GOTOPOS, nLastPos);
SendMessage(SCI_SCROLLCARET);

Theoretically SCI_SCROLLCARET is redundant because
SCI_GOTOPOS is supposed to scroll the caret into view,
but I added it just to be sure.

Anyway, the view is NOT scrolled and the caret remains
hidden. Caret position is right as can be verified by
scrolling down the window manually.

Note that this problem is also present (I suppose) in
pythonwin: just try "dir(sys)" enough time to fill the
window and experience the lower part of the text (and
the caret) going out of view.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2005-05-23

    Logged In: YES
    user_id=12579

    Works for me in SciTE 1.63 on Windows XP using this script:

    function GoEnd()
    local nLastLine = scite.SendEditor(SCI_GETLINECOUNT) - 1
    local nLastPos = scite.SendEditor(SCI_GETLINEENDPOSITION,
    nLastLine)
    scite.SendEditor(SCI_GOTOPOS, nLastPos)
    scite.SendEditor(SCI_SCROLLCARET)
    end

    or the simpler

    function GoEnd()
    local nLastPos = scite.SendEditor(SCI_GETLENGTH)
    scite.SendEditor(SCI_GOTOPOS, nLastPos)
    end

    This works with word wrapping on or off and with a long
    wrapped last line or empty last line.

     
  • Neil Hodgson

    Neil Hodgson - 2005-05-23
    • priority: 5 --> 4
    • assigned_to: nobody --> nyamatongwe
     
  • Neil Hodgson

    Neil Hodgson - 2005-06-04
    • status: open --> closed-works-for-me
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks