[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27898] trunk/blender/source/blender/ editors/space_text/text_ops.c: [#21851] Bugfix: [#21254] text editor jump to line crash
Campbell Barton
ideasman42 at gmail.com
Wed Mar 31 10:33:43 CEST 2010
Revision: 27898
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27898
Author: campbellbarton
Date: 2010-03-31 10:33:43 +0200 (Wed, 31 Mar 2010)
Log Message:
-----------
[#21851] Bugfix: [#21254] text editor jump to line crash
by Ignacio Fern?\195?\161ndez (hellmoon666)
Modified Paths:
--------------
trunk/blender/source/blender/editors/space_text/text_ops.c
Modified: trunk/blender/source/blender/editors/space_text/text_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_text/text_ops.c 2010-03-31 07:28:23 UTC (rev 27897)
+++ trunk/blender/source/blender/editors/space_text/text_ops.c 2010-03-31 08:33:43 UTC (rev 27898)
@@ -1595,17 +1595,25 @@
int line= RNA_int_get(op->ptr, "line");
short nlines= txt_get_span(text->lines.first, text->lines.last)+1;
- if(line < 1 || line > nlines)
- return OPERATOR_CANCELLED;
+ if(line < 1)
+ txt_move_toline(text, 1, 0);
+ else if(line > nlines)
+ txt_move_toline(text, nlines-1, 0);
+ else
+ txt_move_toline(text, line-1, 0);
- txt_move_toline(text, line-1, 0);
-
text_update_cursor_moved(C);
WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, text);
return OPERATOR_FINISHED;
}
+static int jump_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ return WM_operator_props_dialog_popup(C,op,200,100);
+
+}
+
void TEXT_OT_jump(wmOperatorType *ot)
{
/* identifiers */
@@ -1614,7 +1622,7 @@
ot->description= "Jump cursor to line";
/* api callbacks */
- ot->invoke= WM_operator_props_popup;
+ ot->invoke= jump_invoke;
ot->exec= jump_exec;
ot->poll= text_edit_poll;
More information about the Bf-blender-cvs
mailing list