diff --git a/lib/ace/ext/static_highlight.js b/lib/ace/ext/static_highlight.js
index 08cc4004..24c97195 100644
--- a/lib/ace/ext/static_highlight.js
+++ b/lib/ace/ext/static_highlight.js
@@ -70,12 +70,12 @@ exports.render = function(input, mode, theme, lineStart, disableGutter) {
var stringBuilder = [];
var length = session.getLength();
-
+
for(var ix = 0; ix < length; ix++) {
stringBuilder.push("
");
if (!disableGutter)
stringBuilder.push("" + (ix + lineStart) + "");
- textLayer.$renderLine(stringBuilder, 0, true, false);
+ textLayer.$renderLine(stringBuilder, ix, true, false);
stringBuilder.push("
");
}
diff --git a/lib/ace/ext/static_highlight_test.js b/lib/ace/ext/static_highlight_test.js
index f6e5c909..707d00ea 100644
--- a/lib/ace/ext/static_highlight_test.js
+++ b/lib/ace/ext/static_highlight_test.js
@@ -16,7 +16,8 @@ module.exports = {
"test simple snippet": function(next) {
var theme = require("../theme/tomorrow");
- var snippet = "/** this is a function\n\
+ var snippet = "\
+/** this is a function\n\
*\n\
*/\n\
function hello (a, b, c) {\n\
@@ -24,23 +25,16 @@ function hello (a, b, c) {\n\
}";
var mode = new JavaScriptMode();
- var isError = false, result;
- try {
- result = highlighter.render(snippet, mode, theme);
- }
- catch (e) {
- console.log(e);
- isError = true;
- }
- // todo: write something more meaningful
- assert.equal(isError, false);
-
+ var result = highlighter.render(snippet, mode, theme);
+ assert.equal(result.html, " 1
2
3
4function hello (a, b, c) {
5 console.log(a * b + c + 'sup?');
6}
");
+ assert.ok(!!result.css);
next();
},
"test css from theme is used": function(next) {
var theme = require("../theme/tomorrow");
- var snippet = "/** this is a function\n\
+ var snippet = "\
+/** this is a function\n\
*\n\
*/\n\
function hello (a, b, c) {\n\
@@ -58,7 +52,8 @@ function hello (a, b, c) {\n\
"test theme classname should be in output html": function (next) {
var theme = require("../theme/tomorrow");
- var snippet = "/** this is a function\n\
+ var snippet = "\
+/** this is a function\n\
*\n\
*/\n\
function hello (a, b, c) {\n\