Showing with 3,163 additions and 786 deletions.
  1. +2 −0 .gitignore
  2. +6 −0 .travis.yml
  3. +1 −1 README.md
  4. +1 −0 demo/activeline.html
  5. +1 −0 demo/changemode.html
  6. +1 −0 demo/closetag.html
  7. +1 −0 demo/complete.html
  8. +1 −0 demo/emacs.html
  9. +1 −0 demo/folding.html
  10. +1 −0 demo/formatting.html
  11. +1 −0 demo/fullscreen.html
  12. +1 −0 demo/loadmode.html
  13. +2 −1 demo/marker.html
  14. +1 −0 demo/matchhighlighter.html
  15. +1 −0 demo/multiplex.html
  16. +1 −0 demo/mustache.html
  17. +1 −1 demo/preview.html
  18. +1 −0 demo/resize.html
  19. +1 −0 demo/runmode.html
  20. +1 −0 demo/search.html
  21. +1 −0 demo/theme.html
  22. +1 −0 demo/vim.html
  23. +6 −14 demo/visibletabs.html
  24. +1 −0 demo/xmlcomplete.html
  25. +3 −1 doc/compress.html
  26. +1 −1 doc/internals.html
  27. +34 −13 doc/manual.html
  28. +14 −2 doc/oldrelease.html
  29. +1 −1 doc/reporting.html
  30. +1 −1 doc/upgrade_v2.2.html
  31. +50 −41 index.html
  32. +6 −5 keymap/vim.js
  33. +15 −11 lib/codemirror.css
  34. +354 −348 lib/codemirror.js
  35. +4 −1 lib/util/dialog.js
  36. +1 −1 lib/util/formatting.js
  37. +3 −3 lib/util/javascript-hint.js
  38. +1 −1 lib/util/loadmode.js
  39. +1 −1 lib/util/multiplex.js
  40. +1 −1 lib/util/pig-hint.js
  41. +8 −4 lib/util/runmode.js
  42. +4 −4 lib/util/search.js
  43. +13 −11 lib/util/searchcursor.js
  44. +89 −68 lib/util/simple-hint.js
  45. +8 −8 lib/util/xml-hint.js
  46. +6 −2 mode/clike/clike.js
  47. +1 −0 mode/clike/index.html
  48. +1 −0 mode/clike/scala.html
  49. +1 −1 mode/clojure/clojure.js
  50. +1 −0 mode/clojure/index.html
  51. +3 −3 mode/coffeescript/coffeescript.js
  52. +1 −0 mode/coffeescript/index.html
  53. +52 −2 mode/css/css.js
  54. +1 −0 mode/css/index.html
  55. +1 −0 mode/diff/index.html
  56. +1 −1 mode/ecl/ecl.js
  57. +1 −0 mode/erlang/index.html
  58. +4 −3 mode/gfm/gfm.js
  59. +1 −0 mode/gfm/index.html
  60. +2 −2 mode/go/go.js
  61. +1 −0 mode/go/index.html
  62. +1 −1 mode/groovy/groovy.js
  63. +1 −0 mode/groovy/index.html
  64. +2 −2 mode/haskell/haskell.js
  65. +1 −0 mode/haskell/index.html
  66. +4 −4 mode/haxe/haxe.js
  67. +1 −0 mode/haxe/index.html
  68. +3 −3 mode/htmlembedded/htmlembedded.js
  69. +1 −0 mode/htmlembedded/index.html
  70. +1 −1 mode/htmlmixed/htmlmixed.js
  71. +1 −0 mode/htmlmixed/index.html
  72. +1 −0 mode/javascript/index.html
  73. +2 −2 mode/javascript/javascript.js
  74. +1 −0 mode/jinja2/index.html
  75. +124 −2 mode/less/index.html
  76. +94 −60 mode/less/less.js
  77. +1 −0 mode/lua/index.html
  78. +1 −0 mode/markdown/index.html
  79. +4 −4 mode/markdown/markdown.js
  80. +1 −0 mode/mysql/index.html
  81. +1 −0 mode/ntriples/index.html
  82. +4 −4 mode/ntriples/ntriples.js
  83. +1 −1 mode/ocaml/ocaml.js
  84. +1 −0 mode/pascal/index.html
  85. +1 −1 mode/pascal/pascal.js
  86. +1 −0 mode/perl/index.html
  87. +71 −71 mode/perl/perl.js
  88. +1 −0 mode/php/index.html
  89. +3 −3 mode/php/php.js
  90. +1 −0 mode/pig/index.html
  91. +3 −3 mode/pig/pig.js
  92. +1 −0 mode/plsql/index.html
  93. +1 −0 mode/properties/index.html
  94. +1 −0 mode/python/index.html
  95. +1 −1 mode/python/python.js
  96. +1 −0 mode/r/index.html
  97. +1 −0 mode/rpm/changes/index.html
  98. +1 −0 mode/rpm/spec/index.html
  99. +1 −0 mode/rst/index.html
  100. +1 −0 mode/ruby/index.html
  101. +1 −0 mode/rust/index.html
  102. +1 −0 mode/scheme/index.html
  103. +1 −1 mode/scheme/scheme.js
  104. +1 −1 mode/shell/shell.js
  105. +23 −0 mode/sieve/LICENSE
  106. +81 −0 mode/sieve/index.html
  107. +156 −0 mode/sieve/sieve.js
  108. +1 −0 mode/smalltalk/index.html
  109. +2 −2 mode/smalltalk/smalltalk.js
  110. +1 −0 mode/smarty/index.html
  111. +2 −2 mode/smarty/smarty.js
  112. +1 −0 mode/sparql/index.html
  113. +1 −0 mode/stex/index.html
  114. +1 −1 mode/stex/stex.js
  115. +1 −0 mode/stex/test.html
  116. +1 −0 mode/tiddlywiki/index.html
  117. +1 −0 mode/tiki/index.html
  118. +4 −4 mode/tiki/tiki.js
  119. +1 −0 mode/vb/index.html
  120. +1 −0 mode/vbscript/index.html
  121. +1 −0 mode/velocity/index.html
  122. +1 −1 mode/velocity/velocity.js
  123. +1 −0 mode/verilog/index.html
  124. +1 −1 mode/verilog/verilog.js
  125. +1 −0 mode/xml/index.html
  126. +2 −2 mode/xml/xml.js
  127. +3 −2 mode/xquery/index.html
  128. +7 −4 mode/xquery/xquery.js
  129. +1 −0 mode/yaml/index.html
  130. +14 −22 package.json
  131. +29 −18 test/driver.js
  132. +9 −2 test/index.html
  133. +120 −0 test/lint/lint.js
  134. +1,372 −0 test/lint/parse-js.js
  135. +30 −0 test/phantom_driver.js
  136. +32 −0 test/run.js
  137. +189 −2 test/test.js
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/npm-debug.log
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: node_js
node_js:
- 0.8
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CodeMirror 2
# CodeMirror [![Build Status](https://secure.travis-ci.org/marijnh/CodeMirror.png?branch=master)](http://travis-ci.org/marijnh/CodeMirror)

CodeMirror is a JavaScript component that provides a code editor in
the browser. When a mode is available for the language you are coding
Expand Down
1 change: 1 addition & 0 deletions demo/activeline.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Active Line Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down
1 change: 1 addition & 0 deletions demo/changemode.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Mode-Changing Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down
1 change: 1 addition & 0 deletions demo/closetag.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Close-Tag Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down
1 change: 1 addition & 0 deletions demo/complete.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Autocomplete Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down
1 change: 1 addition & 0 deletions demo/emacs.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Emacs bindings demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down
1 change: 1 addition & 0 deletions demo/folding.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Code Folding Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down
1 change: 1 addition & 0 deletions demo/formatting.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Formatting Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down
1 change: 1 addition & 0 deletions demo/fullscreen.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Full Screen Editing</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down
1 change: 1 addition & 0 deletions demo/loadmode.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Lazy Mode Loading Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion demo/marker.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Breakpoint Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down Expand Up @@ -36,7 +37,7 @@ <h1>CodeMirror: Breakpoint demo</h1>
<p>Click the line-number gutter to add or remove 'breakpoints'.</p>

<script>
CodeMirror.fromTextArea(document.getElementById("code"), {
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
onGutterClick: function(cm, n) {
var info = cm.lineInfo(n);
Expand Down
1 change: 1 addition & 0 deletions demo/matchhighlighter.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Match Highlighter Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down
1 change: 1 addition & 0 deletions demo/multiplex.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Multiplexing Parser Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down
1 change: 1 addition & 0 deletions demo/mustache.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Overlay Parser Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion demo/preview.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: HTML5 preview</title>
<meta charset=utf-8>
<script src=../lib/codemirror.js></script>
<script src=../mode/xml/xml.js></script>
<script src=../mode/javascript/javascript.js></script>
Expand Down
1 change: 1 addition & 0 deletions demo/resize.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Autoresize Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down
1 change: 1 addition & 0 deletions demo/runmode.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Mode Runner Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down
1 change: 1 addition & 0 deletions demo/search.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Search/Replace Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down
1 change: 1 addition & 0 deletions demo/theme.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Theme Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down
1 change: 1 addition & 0 deletions demo/vim.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Vim bindings demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down
20 changes: 6 additions & 14 deletions demo/visibletabs.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Visible tabs demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand All @@ -9,16 +10,10 @@

<style type="text/css">
.CodeMirror {border-top: 1px solid #eee; border-bottom: 1px solid #eee;}
.cm-tab:after {
content: "\21e5";
display: -moz-inline-block;
display: -webkit-inline-block;
display: inline-block;
width: 0px;
position: relative;
overflow: visible;
left: -1.4em;
color: #aaa;
.cm-tab {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAAXNSR0IArs4c6QAAAGFJREFUSMft1LsRQFAQheHPowAKoACx3IgEKtaEHujDjORSgWTH/ZOdnZOcM/sgk/kFFWY0qV8foQwS4MKBCS3qR6ixBJvElOobYAtivseIE120FaowJPN75GMu8j/LfMwNjh4HUpwg4LUAAAAASUVORK5CYII=);
background-position: right;
background-repeat: no-repeat;
}
</style>
</head>
Expand All @@ -42,10 +37,7 @@ <h1>CodeMirror: Visible tabs demo</h1>
</textarea></form>

<p>Tabs inside the editor are spans with the
class <code>cm-tab</code>, and can be styled. This demo uses
an <code>:after</code> pseudo-class CSS hack that will not work on old
browsers. You can use a more conservative technique like a background
image as an alternative.</p>
class <code>cm-tab</code>, and can be styled.

<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
Expand Down
1 change: 1 addition & 0 deletions demo/xmlcomplete.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: XML Autocomplete Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
Expand Down
4 changes: 3 additions & 1 deletion doc/compress.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>CodeMirror: Compression Helper</title>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/>
<link rel="stylesheet" type="text/css" href="docs.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>

Expand All @@ -27,6 +27,7 @@ <h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMi
<input type="hidden" id="download" name="download" value="codemirror-compressed.js"/>
<p>Version: <select id="version" onchange="setVersion(this);" style="padding: 1px">
<option value="http://codemirror.net/">HEAD</option>
<option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.33;f=">2.33</option>
<option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.32;f=">2.32</option>
<option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.31;f=">2.31</option>
<option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.3;f=">2.3</option>
Expand Down Expand Up @@ -92,6 +93,7 @@ <h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMi
<option value="http://codemirror.net/mode/rust/rust.js">rust.js</option>
<option value="http://codemirror.net/mode/scheme/scheme.js">scheme.js</option>
<option value="http://codemirror.net/mode/shell/shell.js">shell.js</option>
<option value="http://codemirror.net/mode/sieve/sieve.js">sieve.js</option>
<option value="http://codemirror.net/mode/smalltalk/smalltalk.js">smalltalk.js</option>
<option value="http://codemirror.net/mode/smarty/smarty.js">smarty.js</option>
<option value="http://codemirror.net/mode/sparql/sparql.js">sparql.js</option>
Expand Down
2 changes: 1 addition & 1 deletion doc/internals.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>CodeMirror: Internals</title>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/>
<link rel="stylesheet" type="text/css" href="docs.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style>dl dl {margin: 0;} .update {color: #d40 !important}</style>
</head>
<body>
Expand Down
47 changes: 34 additions & 13 deletions doc/manual.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>CodeMirror: User Manual</title>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/>
<link rel="stylesheet" type="text/css" href="docs.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style>dl dl {margin: 0;}</style>
</head>
<body>
Expand Down Expand Up @@ -161,7 +161,7 @@ <h2 id="config">Configuration</h2>
Default is true.</dd>

<dt id="option_autoClearEmptyLines"><code>autoClearEmptyLines (boolean)</code></dt>
<dd>When turned on (default is off), this will clear
<dd>When turned on (default is off), this will
automatically clear lines consisting only of whitespace when the
cursor leaves them. This is mostly useful to prevent auto
indentation from introducing trailing whitespace in a file.</dd>
Expand Down Expand Up @@ -227,6 +227,13 @@ <h2 id="config">Configuration</h2>
<dd>Will be called when the cursor or selection moves, or any
change is made to the editor content.</dd>

<dt id="option_onViewportChange"><code>onViewportChange (function)</code></dt>
<dd>When given, will be called whenever
the <a href="#getViewport">view port</a> of the editor changes
(due to scrolling, editing, or any other factor). It will be
passed three arguments, the editor instance, the start of the
viewport, and its end.</dd>

<dt id="option_onGutterClick"><code>onGutterClick (function)</code></dt>
<dd>When given, will be called whenever the editor gutter (the
line-number area) is clicked. Will be given the editor instance
Expand Down Expand Up @@ -254,6 +261,10 @@ <h2 id="config">Configuration</h2>
<dd>Determines whether brackets are matched whenever the cursor
is moved next to a bracket.</dd>

<dt id="option_cursorBlinkRate"><code>cursorBlinkRate (number)</code></dt>
<dd>Half-period in milliseconds used for cursor blinking. The default blink
rate is 530ms.</dd>

<dt id="option_workTime"><code>workTime, workDelay (number)</code></dt>
<dd>Highlighting is done by a pseudo background-thread that will
work for <code>workTime</code> milliseconds, and then use
Expand Down Expand Up @@ -281,9 +292,10 @@ <h2 id="config">Configuration</h2>
<dd>Can be used to make CodeMirror focus itself on
initialization. Defaults to off.
When <a href="#fromTextArea"><code>fromTextArea</code></a> is
used, and no explicit value is given for this option, it will
inherit the setting from the textarea's <code>autofocus</code>
attribute.</dd>
used, and no explicit value is given for this option, it will be
set to true when either the source textarea is focused, or it
has an <code>autofocus</code> attribute and no other element is
focused.</dd>

<dt id="option_dragDrop"><code>dragDrop (boolean)</code></dt>
<dd>Controls whether drag-and-drop is enabled. On by default.</dd>
Expand Down Expand Up @@ -346,14 +358,15 @@ <h2 id="keymaps">Keymaps</h2>
default bindings.</p>

<p>The values of properties in keymaps can be either functions of
a single argument (the CodeMirror instance), or strings. Such
strings refer to properties of the
a single argument (the CodeMirror instance), strings, or
<code>false</code>. Such strings refer to properties of the
<code>CodeMirror.commands</code> object, which defines a number of
common commands that are used by the default keybindings, and maps
them to functions. A key handler function may throw
<code>CodeMirror.Pass</code> to indicate that it has decided not
to handle the key, and other handlers (or the default behavior)
should be given a turn.</p>
them to functions. If the property is set to <code>false</code>,
CodeMirror leaves handling of the key up to the browser. A key
handler function may throw <code>CodeMirror.Pass</code> to indicate
that it has decided not to handle the key, and other handlers (or
the default behavior) should be given a turn.</p>

<p>Keys mapped to command names that start with the
characters <code>"go"</code> (which should be used for
Expand Down Expand Up @@ -651,6 +664,15 @@ <h2 id="api">Programming API</h2>
<dt id="getLineHandle"><code>getLineHandle(num) → lineHandle</code></dt>
<dd>Fetches the line handle for the given line number.</dd>

<dt id="getViewport"><code>getViewport() → object</code></dt>
<dd>Returns a <code>{from, to}</code> object indicating the
start (inclusive) and end (exclusive) of the currently displayed
part of the document. In big documents, when most content is
scrolled out of view, CodeMirror will only render the visible
part, and a margin around it. See also
the <a href="#option_onViewportChange"><code>onViewportChange</code></a>
option.</dd>

<dt id="addWidget"><code>addWidget(pos, node, scrollIntoView)</code></dt>
<dd>Puts <code>node</code>, which should be an absolutely
positioned DOM node, into the editor, positioned right below the
Expand Down Expand Up @@ -991,8 +1013,7 @@ <h2 id="modeapi">Writing CodeMirror Modes</h2>

<dt><code>peek() → character</code></dt>
<dd>Returns the next character in the stream without advancing
it. Will return <code>undefined</code> at the end of the
line.</dd>
it. Will return an empty string at the end of the line.</dd>
<dt><code>next() → character</code></dt>
<dd>Returns the next character in the stream and advances it.
Also returns <code>undefined</code> when no more characters are
Expand Down
Loading