[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52473] trunk/blender/source/blender/ editors/space_console/console_ops.c: fix for clear line adjusting console selection.

Campbell Barton ideasman42 at gmail.com
Thu Nov 22 10:49:57 CET 2012


Revision: 52473
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52473
Author:   campbellbarton
Date:     2012-11-22 09:49:56 +0000 (Thu, 22 Nov 2012)
Log Message:
-----------
fix for clear line adjusting console selection.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_console/console_ops.c

Modified: trunk/blender/source/blender/editors/space_console/console_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_console/console_ops.c	2012-11-22 09:20:36 UTC (rev 52472)
+++ trunk/blender/source/blender/editors/space_console/console_ops.c	2012-11-22 09:49:56 UTC (rev 52473)
@@ -157,10 +157,9 @@
 	ConsoleLine *ci = MEM_callocN(sizeof(ConsoleLine), "ConsoleLine Add");
 	
 	if (from) {
-		ci->line = BLI_strdup(from->line);
-		ci->len = strlen(ci->line);
-		ci->len_alloc = ci->len;
-		
+		BLI_assert(strlen(from->line) == from->len);
+		ci->line = BLI_strdupn(from->line, from->len);
+		ci->len = ci->len_alloc = from->len;
 		ci->cursor = from->cursor;
 		ci->type = from->type;
 	}
@@ -625,6 +624,7 @@
 
 	console_history_add(C, ci);
 	console_history_add(C, NULL);
+	console_select_offset(sc, -ci->len);
 
 	console_textview_update_rect(sc, ar);
 




More information about the Bf-blender-cvs mailing list