Menu

editor.newline() -- must it not be there?

Help
nofun
2011-01-13
2013-01-25
  • nofun

    nofun - 2011-01-13

    editor.tab() works great, while editor.newline() produces an AttributeError: 'Editor' object has no attribute 'newline'.
    Although both are listed in 'Keyboard commands' section of Scintilla's docs.
    Why is that?

    My intention was to use editor.newline() instead of editor.addtext("\n") to have a new line properly indented.
    Or is there some other way to imitate Enter key pressing?
    Of cause I could take a whole line and count leading tabs, but I'm total noob in Python, so for now I'd like to keep it as simple as possible.

    Thanks for great plugin and impressive documentation!

     
  • Dave Brotherstone

    It's case sensitive - editor.newLine()
    Docs here:
    http://npppythonscript.sourceforge.net/docs/latest/scintilla.html#Editor.newLine

    You can always do

    help(editor)

    as well to get the list of methods on the editor object.

    Glad you like it!

    Cheers,
    Dave.

     
  • nofun

    nofun - 2011-01-13

    Ouch! How stupid of me! :)

    Yet another thanks, now for quick answer and for help() hint.

    P.S. You are wrong saying I like it. Because I admire and love it! I know almost nothing of Python, but prefer your plugin over JavaScipt, which I know much better. I think it means someting ;)

     

Log in to post a comment.