Erroneous return from Scintilla function

Help
2011-08-26
2013-01-25
  • Mike Cowperthwaite

    64-bit Windows 7. Notepad 5.9.3. PythonScript 0.9.3.1.
    I have a couple of scripts I use to scroll the current line to the top or bottom of the window. I just got this new system set up (new job) and those commands aren't working. On debugging, I see a case where, for instance, the first visible line is #493, the line with the cursor is #515, and editor.getFirstVisibleLine() is returning 516, which is breaking the script. (I'm not sure if the actual cursor line has anything to do with the return value.)

    Here's the script:

    line = editor.getFirstVisibleLine() + editor.linesOnScreen() - 1
    end = editor.getLineEndPosition(line)
    pos = editor.findColumn(line, editor.getColumn(editor.getCurrentPos()))
    editor.gotoPos(min(pos, end))
    if end < pos:
        editor.lineEnd()  # hack: gotoPos() doesn't change lineUp/lineDown target column
    
     
  • Dave Brotherstone

    From the scintilla documentation (http://www.scintilla.org/ScintillaDoc.html#SCI_GETFIRSTVISIBLELINE) I'd guess this has something to do with line wrapping or hidden lines.  Check if you've got line wrap on, and if you've got any folded sections.

    I don't think it's a python issue, as the numbers get passed straight through from Scintilla…

     
  • Mike Cowperthwaite

    You're quite right! Bother.

     

Log in to post a comment.

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

Sign up for the SourceForge newsletter:





No, thanks