Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix bug with getCode sometimes clipping off the last line on WebKit

  • Loading branch information...
commit 86bdfe19d4647291bc352aa5401d295b957a3551 1 parent 7d121a2
@marijnh authored
View
2  js/editor.js
@@ -496,11 +496,11 @@ var Editor = (function(){
var accum = [];
select.markSelection();
forEach(traverseDOM(this.container.firstChild), method(accum, "push"));
- webkitLastLineHack(this.container);
select.selectMarked();
// On webkit, don't count last (empty) line if the webkitLastLineHack BR is present
if (webkit && this.container.lastChild.hackBR)
accum.pop();
+ webkitLastLineHack(this.container);
return cleanText(accum.join(""));
},
View
0  unittests.js → js/unittests.js
File renamed without changes
View
7 unittests.html
@@ -9,7 +9,7 @@
<head>
<title>Test Harness for CodeMirror</title>
- <script type="text/javascript" src="unittests.js"></script>
+ <script type="text/javascript" src="js/unittests.js"></script>
<script type="text/javascript">
// Counters for unit test results.
@@ -105,7 +105,7 @@
</script>
</head>
- <body onload="initTests()">
+ <body>
<h1>Test Harness for CodeMirror</h1>
<div id="testoutput"></div>
<hr>
@@ -116,7 +116,8 @@
<script>
var editor = new CodeMirror(CodeMirror.replace(document.getElementById('inputfield')), {
parserfile: ["tokenizejavascript.js", "parsejavascript.js"],
- path: "js/"
+ path: "js/",
+ initCallback: initTests
});
</script>
Please sign in to comment.
Something went wrong with that request. Please try again.