Help save net neutrality! Learn more.

Erroneous return from Scintilla function

  • Mike Cowperthwaite

    64-bit Windows 7. Notepad 5.9.3. PythonScript
    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 ( 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.