![]() I used the Python indenter that comes with PyPN as a some sort of a starting point (I must notify that there is a redundant piece of code in that one - there is no need to check if the character is EOL as that's already done in ''pypn.glue''). With the current lack of documentation and some bugs in PyPN creating scripts is often about learning from errors. IndentLine ( l_cur - 1, c_ind ) Final Words GetLineIndentation ( l_cur - 2 ) if c_ind = p_ind : c_ind -= tab sci. GetLineIndentation ( l_cur ) p_ind = sci. IndentLine ( l_cur, c_ind ) elif kw in u_kws : c_ind = sci. GetLineIndentation ( l_cur - 1 ) if c_ind = p_ind or c_ind = 0 : c_ind += tab sci. ![]() PositionFromLine ( l_cur - 1 ) t_end = pos - 1 txt = sci. tab = 2 ( "tes" ) def tes_indent ( c, doc ): sci = scintilla. i_kws = # Keywords that cause unindentation. Import scintilla from corators import indenter # Keywords that cause indentation. Inside the Function: Functionalityįirst, let's figure out what we're trying to do. With this information at hand we can move on.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |