I have a python editor where the user is entering a script or code, which is then put into a main method behind the scenes, while also having every line indented. The proble
The only way i see - is to strip first n tabs for each line starting with second, where n is known identation of main method.
If that identation is not known beforehand - you can add trailing newline before inserting it and strip number of tabs from the last line...
The third solution is to parse data and find beginning of multiline quote and do not add your identation to every line after until it will be closed.
Think there is a better solution..