I am making a text editor it has all the features but not an auto-indent feature which can automatically add spaces after loops or conditions. Please tell me how can I make, and please try to give a code which can do it. I am making this in Tkinter and want this function in the text widget. I had made this text editor.
I made this in Tkinter so please help me to give a code for auto-indent. I had tried for firing events whenever a user presses ':' button to give an indent in the next line but it does not follow the pattern of multilevel indenting. like
for i in range(100):
if i==5:
break
else:
print('got till '+str(i))
but my code does not follow like this it only adds space in the first line so the code looks like.
for i in range(100):
if i==5:
break
else:
print('got till '+str(i))
so it is a bit tricky. Please comment for any related info or question but please answer me.