Hi Campbell, This behavior is convenient for keyboard inputs, but very annoying when copy&pasting a multiline code from text editor because the indentation unwantedly changed causes IndentationError...
Cannot the auto-indent be disabled when pasting a code from clipboard? IRIE Shinsuke 13/05/08, Campbell Barton wrote: > Revision: 56558 > > http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56558 > Author: campbellbarton > Date: 2013-05-08 12:57:00 +0000 (Wed, 08 May 2013) > Log Message: > ----------- > auto indent for multi-line python statements. > > Modified Paths: > -------------- > trunk/blender/release/scripts/modules/console_python.py > > Modified: trunk/blender/release/scripts/modules/console_python.py > =================================================================== > --- trunk/blender/release/scripts/modules/console_python.py 2013-05-08 > 12:56:51 UTC (rev 56557) > +++ trunk/blender/release/scripts/modules/console_python.py 2013-05-08 > 12:57:00 UTC (rev 56558) > @@ -190,12 +190,17 @@ > > if is_multiline: > sc.prompt = PROMPT_MULTI > + indent = line[:len(line) - len(line.lstrip())] > + if line.rstrip().endswith(":"): > + indent += " " > else: > sc.prompt = PROMPT > + indent = "" > > # insert a new blank line > - bpy.ops.console.history_append(text="", current_character=0, > + bpy.ops.console.history_append(text=indent, current_character=0, > remove_duplicates=True) > + sc.history[-1].current_character = len(indent) > > # Insert the output into the editor > # not quite correct because the order might have changed, > > _______________________________________________ > Bf-blender-cvs mailing list > [email protected] > http://lists.blender.org/mailman/listinfo/bf-blender-cvs > _______________________________________________ Bf-committers mailing list [email protected] http://lists.blender.org/mailman/listinfo/bf-committers
