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!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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 ;)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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!
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.
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 ;)