JSDOC/TextStream.vala
authorAlan Knowles <alan@roojs.com>
Tue, 15 Sep 2015 09:28:56 +0000 (17:28 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 15 Sep 2015 09:28:56 +0000 (17:28 +0800)
JSDOC/TextStream.vala

index 4ebddae..9182c28 100644 (file)
@@ -37,7 +37,7 @@ namespace JSDOC {
             if (this.cursor+n < 0 || this.cursor+n >= this.length) {
                 return '\0';
             }
-            return  this.text[this.cursor+n];
+            return  this.get_char(this.cursor+n);
         },
         
         public bool lookEOF(int n = 0)
@@ -57,9 +57,11 @@ namespace JSDOC {
             }
                 
             char pulled;
-            for (var i = 0; i < n; i++) {
+            var i = 0;
+            while (i < n) {
                 if (this.cursor+i < this.length) {
                     pulled += this.text.get_char(this.cursor+i);
+                    i+=pulled.to_string.length();
                 } else {
                     eof =true;
                     return '\0';