update smarty mode
fix infinite loop when inserting snippet with self referencing tabstop

fixes #1802
fix broken python snippet