Fix #33398: Missed undo push when script execution failed
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 3 Dec 2012 16:47:38 +0000 (16:47 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 3 Dec 2012 16:47:38 +0000 (16:47 +0000)
Undo push was missed in cases when script failed to run with some error
when using Run Script in text editor. As far as i can see it makes sense
to skip undo push here only in cases live editing is enabled.

Otherwise it's indeed annoying to return to previous scene state when
debugging the script.

source/blender/editors/space_text/text_ops.c

index cd6d871..5b7f927 100644 (file)
@@ -615,6 +615,8 @@ static int text_run_script(bContext *C, ReportList *reports)
                }
 
                BKE_report(reports, RPT_ERROR, "Python script fail, look in the console for now...");
+
+               return OPERATOR_FINISHED;
        }
 #else
        (void)C;