[gcalctool/vala] Really fix ans detection



commit e5c53aa35448bbe45f270dfe792e823fb3f73421
Author: Robert Ancell <robert ancell canonical com>
Date:   Fri Oct 12 21:45:14 2012 +1300

    Really fix ans detection

 src/math-equation.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/math-equation.vala b/src/math-equation.vala
index 2b54ec4..df6a06a 100644
--- a/src/math-equation.vala
+++ b/src/math-equation.vala
@@ -623,7 +623,7 @@ public class MathEquation : Gtk.TextBuffer
         if (ans_start_mark != null)
             get_ans_offsets (out ans_start, out ans_end);
         if (ans_start >= 0)
-            text = text.substring (0, ans_start) + "ans" + text.substring (ans_end);
+            text = text.splice (text.index_of_nth_char (ans_start), text.index_of_nth_char (ans_end), "ans");
 
         var last_is_digit = false;
         var index = 0;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]