Which mode do you use for text file? plain_text mode doesn't keep indent level and text mode does.
I think it is better to let the mode to handle indentation.