Permalink
Browse files

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

  • Loading branch information...
1 parent 7d121a2 commit 86bdfe19d4647291bc352aa5401d295b957a3551 @marijnh marijnh committed Nov 9, 2010
Showing with 5 additions and 4 deletions.
  1. +1 −1 js/editor.js
  2. 0 { → js}/unittests.js
  3. +4 −3 unittests.html
View
@@ -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(""));
},
File renamed without changes.
View
@@ -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>

0 comments on commit 86bdfe1

Please sign in to comment.