Skip to content

Commit 03a48c9

Browse files
committed
Merge remote-tracking branch 'codemirror/master'
2 parents b407d9e + c11f34f commit 03a48c9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+813
-111
lines changed

AUTHORS

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Ahmad M. Zawawi
1919
ahoward
2020
Akeksandr Motsjonov
2121
Alasdair Smith
22+
AlbertHilb
2223
Alberto González Palomo
2324
Alberto Pose
2425
Albert Xing
@@ -101,10 +102,13 @@ Bharad
101102
BigBlueHat
102103
Billy Moon
103104
binny
105+
Bjorn Hansen
104106
B Krishna Chaitanya
105107
Blaine G
106108
blukat29
109+
Bo
107110
boomyjee
111+
Bo Peng
108112
borawjm
109113
Brad Metcalf
110114
Brandon Frohs
@@ -137,6 +141,7 @@ Chris Smith
137141
Christian Gruen
138142
Christian Oyarzun
139143
Christian Petrov
144+
christopherblaser
140145
Christopher Brown
141146
Christopher Kramer
142147
Christopher Mitchell
@@ -202,6 +207,7 @@ Elisée
202207
Emmanuel Schanzer
203208
Enam Mijbah Noor
204209
Eric Allam
210+
Eric Bogard
205211
Erik Welander
206212
eustas
207213
Fabien Dubosson
@@ -243,6 +249,7 @@ Giovanni Calò
243249
Glebov Boris
244250
Glenn Jorde
245251
Glenn Ruehle
252+
goldsmcb
246253
Golevka
247254
Google Inc.
248255
Gordon Smith
@@ -266,6 +273,7 @@ Hélio
266273
Hendrik Wallbaum
267274
Henrik Haugbølle
268275
Herculano Campos
276+
hidaiy
269277
Hiroyuki Makino
270278
hitsthings
271279
Hocdoc
@@ -364,6 +372,7 @@ Justin Hileman
364372
jwallers@gmail.com
365373
kaniga
366374
karevn
375+
Karol
367376
Kayur Patel
368377
Kazuhito Hokamura
369378
Ken Newman
@@ -387,6 +396,7 @@ Kyle Kelley
387396
KyleMcNutt
388397
Lanfei
389398
Lanny
399+
laobubu
390400
Laszlo Vidacs
391401
leaf corcoran
392402
Lemmon
@@ -449,6 +459,7 @@ matthewhayes
449459
Matthew Rathbone
450460
Matthias Bussonnier
451461
Matthias BUSSONNIER
462+
Matt MacPherson
452463
Matt McDonald
453464
Matt Pass
454465
Matt Sacks
@@ -484,17 +495,20 @@ Mike Diaz
484495
Mike Ivanov
485496
Mike Kadin
486497
Mike Kobit
498+
Milan Szekely
487499
MinRK
488500
Miraculix87
489501
misfo
490502
mkaminsky11
491503
mloginov
504+
Moritz Schubotz (physikerwelt)
492505
Moritz Schwörer
493506
Moshe Wajnberg
494507
mps
495508
ms
496509
mtaran-google
497510
Mu-An Chiou
511+
Mu-An ✌️ Chiou
498512
mzabuawala
499513
Narciso Jaramillo
500514
Nathan Williams
@@ -531,6 +545,7 @@ overdodactyl
531545
pablo
532546
pabloferz
533547
Pablo Zubieta
548+
paddya
534549
Page
535550
paladox
536551
Panupong Pasupat
@@ -580,6 +595,7 @@ ray ratchup
580595
Ray Ratchup
581596
Remi Nyborg
582597
Renaud Durlin
598+
Reynold Xin
583599
Richard Denton
584600
Richard van der Meer
585601
Richard Z.H. Wang
@@ -640,6 +656,7 @@ Sorab Bisht
640656
spastorelli
641657
srajanpaliwal
642658
Stanislav Oaserele
659+
stan-z
643660
Stas Kobzar
644661
Stefan Borsje
645662
Steffen Beyer
@@ -695,8 +712,10 @@ Travis Heppe
695712
Triangle717
696713
Tristan Tarrant
697714
TSUYUSATO Kitsune
715+
Tugrul Elmas
698716
twifkak
699717
Tyler Long
718+
Vadzim Ramanenka
700719
Vaibhav Sagar
701720
VapidWorx
702721
Vestimir Markov
@@ -716,6 +735,7 @@ William Jamieson
716735
William Stein
717736
Willy
718737
Wojtek Ptak
738+
wonderboyjon
719739
Wu Cheng-Han
720740
Xavier Mendez
721741
Yassin N. Hassan

CHANGELOG.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,59 @@
1+
## 5.39.0 (2018-06-20)
2+
3+
### Bug fixes
4+
5+
Fix issue that in some circumstances caused content to be clipped off at the bottom after a resize.
6+
7+
[markdown mode](http://codemirror.net/mode/markdown/): Improve handling of blank lines in HTML tags.
8+
9+
### New features
10+
11+
[stex mode](http://codemirror.net/mode/stex/): Add an `inMathMode` option to start the mode in math mode.
12+
13+
## 5.38.0 (2018-05-21)
14+
15+
### Bug fixes
16+
17+
Improve reliability of noticing a missing mouseup event during dragging.
18+
19+
Make sure `getSelection` is always called on the correct document.
20+
21+
Fix interpretation of line breaks and non-breaking spaces inserted by renderer in contentEditable mode.
22+
23+
Work around some browsers inexplicably making the fake scrollbars focusable.
24+
25+
Make sure `coordsChar` doesn't return positions inside collapsed ranges.
26+
27+
[javascript mode](http://codemirror.net/mode/javascript/): Support block scopes, bindingless catch, bignum suffix, `s` regexp flag.
28+
29+
[markdown mode](http://codemirror.net/mode/markdown/): Adjust a wasteful regexp.
30+
31+
[show-hint addon](http://codemirror.net/doc/manual.html#addon_show-hint): Allow opening the control without any item selected.
32+
33+
### New features
34+
35+
New theme: [darcula](http://codemirror.net/demo/theme.html#darcula).
36+
37+
[dialog addon](http://codemirror.net/doc/manual.html#addon_dialog): Add a CSS class (`dialog-opened`) to the editor when a dialog is open.
38+
39+
## 5.37.0 (2018-04-20)
40+
41+
### Bug fixes
42+
43+
Suppress keypress events during composition, for platforms that don't properly do this themselves.
44+
45+
[xml-fold addon](http://codemirror.net/demo/folding.html): Improve handling of line-wrapped opening tags.
46+
47+
[javascript mode](http://codemirror.net/mode/javascript/): Improve TypeScript support.
48+
49+
[python mode](http://codemirror.net/mode/python/): Highlight expressions inside format strings.
50+
51+
### New features
52+
53+
[vim bindings](http://codemirror.net/demo/vim.html): Add support for '(' and ')' movement.
54+
55+
New themes: [idea](http://codemirror.net/demo/theme.html#idea), [ssms](http://codemirror.net/demo/theme.html#ssms), [gruvbox-dark](http://codemirror.net/demo/theme.html#gruvbox-dark).
56+
157
## 5.36.0 (2018-03-20)
258

359
### Bug fixes

addon/dialog/dialog.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
} else { // Assuming it's a detached DOM element.
2626
dialog.appendChild(template);
2727
}
28+
CodeMirror.addClass(wrap, 'dialog-opened');
2829
return dialog;
2930
}
3031

@@ -47,6 +48,7 @@
4748
} else {
4849
if (closed) return;
4950
closed = true;
51+
CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');
5052
dialog.parentNode.removeChild(dialog);
5153
me.focus();
5254

@@ -102,6 +104,7 @@
102104
function close() {
103105
if (closed) return;
104106
closed = true;
107+
CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');
105108
dialog.parentNode.removeChild(dialog);
106109
me.focus();
107110
}
@@ -141,6 +144,7 @@
141144
if (closed) return;
142145
closed = true;
143146
clearTimeout(doneTimer);
147+
CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');
144148
dialog.parentNode.removeChild(dialog);
145149
}
146150

addon/hint/show-hint.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);
9999
if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||
100100
pos.ch < this.startPos.ch || this.cm.somethingSelected() ||
101-
(pos.ch && this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {
101+
(!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {
102102
this.close();
103103
} else {
104104
var self = this;
@@ -200,7 +200,8 @@
200200
var widget = this, cm = completion.cm;
201201

202202
var hints = this.hints = document.createElement("ul");
203-
hints.className = "CodeMirror-hints";
203+
var theme = completion.cm.options.theme;
204+
hints.className = "CodeMirror-hints " + theme;
204205
this.selectedHint = data.selectedHint || 0;
205206

206207
var completions = data.list;
@@ -333,7 +334,7 @@
333334
i = avoidWrap ? 0 : this.data.list.length - 1;
334335
if (this.selectedHint == i) return;
335336
var node = this.hints.childNodes[this.selectedHint];
336-
node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, "");
337+
if (node) node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, "");
337338
node = this.hints.childNodes[this.selectedHint = i];
338339
node.className += " " + ACTIVE_HINT_ELEMENT_CLASS;
339340
if (node.offsetTop < this.hints.scrollTop)

addon/hint/sql-hint.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,23 @@
275275
if (search.charAt(0) == "." || search.charAt(0) == identifierQuote) {
276276
start = nameCompletion(cur, token, result, editor);
277277
} else {
278-
addMatches(result, search, defaultTable, function(w) {return w;});
279-
addMatches(result, search, tables, function(w) {return w;});
278+
addMatches(result, search, defaultTable, function(w) {return {text:w, className: "CodeMirror-hint-table CodeMirror-hint-default-table"};});
279+
addMatches(
280+
result,
281+
search,
282+
tables,
283+
function(w) {
284+
if (typeof w === 'object') {
285+
w.className = "CodeMirror-hint-table";
286+
} else {
287+
w = {text: w, className: "CodeMirror-hint-table"};
288+
}
289+
290+
return w;
291+
}
292+
);
280293
if (!disableKeywords)
281-
addMatches(result, search, keywords, function(w) {return w.toUpperCase();});
294+
addMatches(result, search, keywords, function(w) {return {text: w.toUpperCase(), className: "CodeMirror-hint-keyword"};});
282295
}
283296

284297
return {list: result, from: Pos(cur.line, start), to: Pos(cur.line, end)};

addon/lint/json-lint.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ CodeMirror.registerHelper("lint", "json", function(text) {
2323
}
2424
return found;
2525
}
26+
// for jsonlint's web dist jsonlint is exported as an object with a single property parser, of which parseError
27+
// is a subproperty
28+
var jsonlint = window.jsonlint.parser || window.jsonlint
2629
jsonlint.parseError = function(str, hash) {
2730
var loc = hash.loc;
2831
found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column),

demo/theme.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<link rel="stylesheet" href="../theme/eclipse.css">
2222
<link rel="stylesheet" href="../theme/elegant.css">
2323
<link rel="stylesheet" href="../theme/erlang-dark.css">
24+
<link rel="stylesheet" href="../theme/gruvbox-dark.css">
2425
<link rel="stylesheet" href="../theme/hopscotch.css">
2526
<link rel="stylesheet" href="../theme/icecoder.css">
2627
<link rel="stylesheet" href="../theme/isotope.css">
@@ -55,6 +56,7 @@
5556
<link rel="stylesheet" href="../theme/xq-light.css">
5657
<link rel="stylesheet" href="../theme/yeti.css">
5758
<link rel="stylesheet" href="../theme/idea.css">
59+
<link rel="stylesheet" href="../theme/darcula.css">
5860
<link rel="stylesheet" href="../theme/zenburn.css">
5961
<script src="../lib/codemirror.js"></script>
6062
<script src="../mode/javascript/javascript.js"></script>
@@ -104,12 +106,14 @@ <h2>Theme Demo</h2>
104106
<option>blackboard</option>
105107
<option>cobalt</option>
106108
<option>colorforth</option>
109+
<option>darcula</option>
107110
<option>dracula</option>
108111
<option>duotone-dark</option>
109112
<option>duotone-light</option>
110113
<option>eclipse</option>
111114
<option>elegant</option>
112115
<option>erlang-dark</option>
116+
<option>gruvbox-dark</option>
113117
<option>hopscotch</option>
114118
<option>icecoder</option>
115119
<option>idea</option>

doc/manual.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<section class=first id=overview>
7070
<h2 style="position: relative">
7171
User manual and reference guide
72-
<span style="color: #888; font-size: 1rem; position: absolute; right: 0; bottom: 0">version 5.36.1</span>
72+
<span style="color: #888; font-size: 1rem; position: absolute; right: 0; bottom: 0">version 5.39.1</span>
7373
</h2>
7474

7575
<p>CodeMirror is a code-editor component that can be embedded in
@@ -292,6 +292,17 @@ <h2>Configuration</h2>
292292
character. By default, a red dot (<span style="color: red"></span>)
293293
is shown, with a title tooltip to indicate the character code.</dd>
294294

295+
<dt id="option_direction"><code><strong>direction</strong>: "ltr" | "rtl"</code></dt>
296+
<dd>Flips overall layout and selects base paragraph direction to
297+
be left-to-right or right-to-left. Default is "ltr".
298+
CodeMirror applies the Unicode Bidirectional Algorithm to each
299+
line, but does not autodetect base direction — it's set to the
300+
editor direction for all lines. The resulting order is
301+
sometimes wrong when base direction doesn't match user intent
302+
(for example, leading and trailing punctuation jumps to the
303+
wrong side of the line). Therefore, it's helpful for
304+
multilingual input to let users toggle this option.
305+
295306
<dt id="option_rtlMoveVisually"><code><strong>rtlMoveVisually</strong>: boolean</code></dt>
296307
<dd>Determines whether horizontal cursor movement through
297308
right-to-left (Arabic, Hebrew) text is visual (pressing the left

doc/realworld.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ <h2>CodeMirror real-world uses</h2>
7070
<li><a href="http://ireneros.com/deck/deck.js-codemirror/introduction/#textarea-code">Deck.js integration</a> (slides with editors)</li>
7171
<li><a href="http://www.dbninja.com">DbNinja</a> (MySQL access interface)</li>
7272
<li><a href="http://www.ecsspert.com/">eCSSpert</a> (CSS demos and experiments)</li>
73+
<li><a href="https://edabit.com">Edabit</a> (coding challenges)</li>
7374
<li><a href="http://elm-lang.org/Examples.elm">Elm language examples</a></li>
7475
<li><a href="http://eloquentjavascript.net/chapter1.html">Eloquent JavaScript</a> (book)</li>
7576
<li><a href="http://emmet.io">Emmet</a> (fast XML editing)</li>
@@ -101,6 +102,7 @@ <h2>CodeMirror real-world uses</h2>
101102
<li><a href="https://joelpinheiro.github.io/itrading/">iTrading</a> (Algorithmic Trading)</li>
102103
<li><a href="http://i-mos.org/imos/">i-MOS</a> (modeling and simulation platform)</li>
103104
<li><a href="http://www.janvas.com/">Janvas</a> (vector graphics editor)</li>
105+
<li><a href="https://code.wetrafa.xyz/">JdBEdit</a> (web IDE)</li>
104106
<li><a href="http://extensions.joomla.org/extensions/edition/editors/8723">Joomla plugin</a></li>
105107
<li><a href="http://jqfundamentals.com/">jQuery fundamentals</a> (interactive tutorial)</li>
106108
<li><a href="http://jsbin.com">jsbin.com</a> (JS playground)</li>
@@ -144,6 +146,7 @@ <h2>CodeMirror real-world uses</h2>
144146
<li><a href="http://refork.com/">Refork</a> (animation demo gallery and sharing)</li>
145147
<li><a href="http://sagecell.sagemath.org">SageMathCell</a> (interactive mathematical software)</li>
146148
<li><a href="https://cloud.sagemath.com/">SageMathCloud</a> (interactive mathematical software environment)</li>
149+
<li><a href="https://github.com/szekelymilan/salvare">salvare</a> (real-time collaborative code editor)</li>
147150
<li><a href="https://chrome.google.com/webstore/detail/servephp/mnpikomdchjhkhbhmbboehfdjkobbfpo">ServePHP</a> (PHP code testing in Chrome dev tools)</li>
148151
<li><a href="http://scala-lang.org/blog/2017/02/20/introducing-scastie.html">Scastie</a> (Scala playground)</li>
149152
<li><a href="https://www.shadertoy.com/">Shadertoy</a> (shader sharing)</li>

0 commit comments

Comments
 (0)