Last active
September 3, 2015 07:49
-
-
Save peterflynn/0f6cd0af22edb543f56f to your computer and use it in GitHub Desktop.
Testcase to repro Brackets bug #10590
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>CodeMirror line widget / wordwrap issue</title> | |
| <script src="http://codemirror.net/lib/codemirror.js"></script> | |
| <link rel="stylesheet" href="http://codemirror.net/lib/codemirror.css"> | |
| <style type="text/css"> | |
| .CodeMirror { | |
| margin: 0; | |
| border: 0; | |
| width: 100%; | |
| } | |
| .CodeMirror .CodeMirror { | |
| height: auto; | |
| width: 100%; | |
| background-color: lightgray; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div id="code"></div> | |
| <script> | |
| // Set up the outer CodeMirror instance | |
| var content = ""; | |
| for (var i = 1; i <= 250; i++) { | |
| content += "line " + i + "\n"; | |
| } | |
| var hostEditor = CodeMirror(document.getElementById("code"), { | |
| lineNumbers: true, | |
| dragDrop: true, | |
| mode: "html", | |
| value: content | |
| }); | |
| hostEditor.setSize(null, 600); | |
| // Add a line widget containing a nested CodeMirror instance | |
| var inlineContent = ""; | |
| for (var i = 1; i <= 15; i++) { | |
| inlineContent += "inline line " + i + "\n"; | |
| } | |
| var container = document.createElement("div"); | |
| var inlineEditor = CodeMirror(container, { | |
| lineNumbers: true, | |
| dragDrop: true, | |
| mode: "html", | |
| value: inlineContent | |
| }); | |
| var lineWidget = hostEditor.addLineWidget(60, container, { | |
| coverGutter: true | |
| }); | |
| inlineEditor.refresh(); | |
| </script> | |
| </body> | |
| </html> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related test cases:
http://jsfiddle.net/9mbm3vnp/1/
http://jsfiddle.net/773ywc6y/