diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-22 14:32:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-22 14:32:29 +0300 |
commit | d60a5cfc552e0f5b6e9143a1d85fcc0208021e1a (patch) | |
tree | d8be151f4961f7ba65a2da228bed60d07203fe44 /source/blender/editors/space_text/text_ops.c | |
parent | ef6cbc3da0af5a05f59969025d75ae6567c0b299 (diff) |
feature back from 2.4x where a python error moves the cursor to the error line, added moving to exact column for syntax errors too.
Diffstat (limited to 'source/blender/editors/space_text/text_ops.c')
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index d8cbe93012d..67d931d0932 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -577,13 +577,22 @@ static int run_script_exec(bContext *C, wmOperator *op) Text *text= CTX_data_edit_text(C); SpaceText *st= CTX_wm_space_text(C); + /* only for comparison */ + void *curl_prev= text->curl; + int curc_prev= text->curc; + if (BPY_text_exec(C, text, op->reports)) return OPERATOR_FINISHED; - + /* Dont report error messages while live editing */ - if(!(st && st->live_edit)) + if(!(st && st->live_edit)) { + if(text->curl != curl_prev || curc_prev != text->curc) { + text_update_cursor_moved(C); + WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text); + } + BKE_report(op->reports, RPT_ERROR, "Python script fail, look in the console for now..."); - + } return OPERATOR_CANCELLED; #endif } |