Skip to content

Commit b70c850

Browse files
committed
Merge remote-tracking branch 'codemirror/master'
2 parents 04659a8 + 6a9c895 commit b70c850

Some content is hidden

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

83 files changed

+1081
-452
lines changed

AUTHORS

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Adam King
1212
Adam Particka
1313
adanlobato
1414
Adán Lobato
15+
Aditya Toshniwal
1516
Adrian Aichner
1617
Adrian Heine
1718
Adrien Bertrand
@@ -134,6 +135,8 @@ Chad Jolly
134135
Chandra Sekhar Pydi
135136
Charles Skelton
136137
Cheah Chu Yeow
138+
Chhekur
139+
Chris Colborne
137140
Chris Coyier
138141
Chris Ford
139142
Chris Granger
@@ -150,6 +153,7 @@ Christopher Brown
150153
Christopher Kramer
151154
Christopher Mitchell
152155
Christopher Pfohl
156+
Christopher Wallis
153157
Chunliang Lyu
154158
ciaranj
155159
CodeAnimal
@@ -237,13 +241,15 @@ Filype Pereira
237241
finalfantasia
238242
flack
239243
Florian Felten
240-
ForbesLindesay
241244
Forbes Lindesay
245+
ForbesLindesay
242246
Ford_Lawnmower
243247
Forrest Oliphant
244248
Franco Catena
245249
Frank Wiegand
250+
fraxx001
246251
Fredrik Borg
252+
FUJI Goro (gfx)
247253
Gabriel Gheorghian
248254
Gabriel Horner
249255
Gabriel Nahmias
@@ -257,6 +263,7 @@ George Stephanis
257263
geowarin
258264
Gerard Braad
259265
Gergely Hegykozi
266+
Germain Chazot
260267
Giovanni Calò
261268
Glebov Boris
262269
Glenn Jorde
@@ -276,6 +283,7 @@ guraga
276283
Gustavo Rodrigues
277284
Hakan Tunc
278285
Hans Engel
286+
Hanzhao Deng
279287
Harald Schilly
280288
Hardest
281289
Harshvardhan Gupta
@@ -316,6 +324,7 @@ James Howard
316324
James Thorne
317325
Jamie Hill
318326
Jamie Morris
327+
Janice Leung
319328
Jan Jongboom
320329
jankeromnes
321330
Jan Keromnes
@@ -328,6 +337,7 @@ Jared Jacobs
328337
Jason
329338
Jason Barnabe
330339
Jason Grout
340+
Jason Heeris
331341
Jason Johnston
332342
Jason San Jose
333343
Jason Siefken
@@ -349,6 +359,7 @@ jochenberger
349359
Jochen Berger
350360
Joel Einbinder
351361
joelpinheiro
362+
joewalsh
352363
Johan Ask
353364
John Connor
354365
John-David Dalton
@@ -359,6 +370,7 @@ John Van Der Loo
359370
Jon Ander Peñalba
360371
Jonas Döbertin
361372
Jonas Helfer
373+
Jonathan Dierksen
362374
Jonathan Hart
363375
Jonathan Malmaud
364376
Jon Gacnik
@@ -373,6 +385,7 @@ Josh Soref
373385
Joshua Newman
374386
Josh Watzman
375387
jots
388+
Joy Zhong
376389
jsoojeon
377390
ju1ius
378391
Juan Benavides Romero
@@ -388,6 +401,8 @@ karevn
388401
Karol
389402
Kayur Patel
390403
Kazuhito Hokamura
404+
Kees de Kooter
405+
Kenan Christian Dimas
391406
Ken Newman
392407
ken restivo
393408
Ken Rockot
@@ -408,12 +423,14 @@ kubelsmieci
408423
KwanEsq
409424
Kyle Kelley
410425
KyleMcNutt
426+
LaKing
411427
Lanfei
412428
Lanny
413429
laobubu
414430
Laszlo Vidacs
415431
leaf corcoran
416432
Lemmon
433+
Leo Baschy
417434
Leonid Khachaturov
418435
Leon Sorokin
419436
Leonya Khachaturov
@@ -452,6 +469,7 @@ Marijn Haverbeke
452469
Mário Gonçalves
453470
Mario Pietsch
454471
Mark Anderson
472+
Mark Dalgleish
455473
Mark Lentczner
456474
Marko Bonaci
457475
Mark Peace
@@ -497,6 +515,7 @@ Michael Goderbauer
497515
Michael Grey
498516
Michael Kaminsky
499517
Michael Lehenbauer
518+
Michael Wadman
500519
Michael Walker
501520
Michael Zhou
502521
Michal Čihař
@@ -525,8 +544,8 @@ Moshe Wajnberg
525544
mps
526545
ms
527546
mtaran-google
528-
Mu-An Chiou
529547
Mu-An ✌️ Chiou
548+
Mu-An Chiou
530549
mzabuawala
531550
Narciso Jaramillo
532551
Nathan Williams
@@ -544,6 +563,7 @@ Nicholas Bollweg (Nick)
544563
NickKolok
545564
Nick Kreeger
546565
Nick Small
566+
Nicolas Chevobbe
547567
Nicolas Kick
548568
Nicolò Ribaudo
549569
Niels van Groningen
@@ -557,6 +577,7 @@ Nisarg Jhaveri
557577
nlwillia
558578
noragrossman
559579
Norman Rzepka
580+
Oleksandr Yakovenko
560581
opl-
561582
Oreoluwa Onatemowo
562583
Oskar Segersvärd
@@ -622,6 +643,7 @@ Richard Z.H. Wang
622643
Rishi Goomar
623644
Robert Brignull
624645
Robert Crossfield
646+
Robert Martin
625647
Roberto Abdelkader Martínez Pérez
626648
robertop23
627649
Robert Plummer
@@ -689,6 +711,7 @@ Steve Champagne
689711
Steve Hoover
690712
Steve O'Hara
691713
stoskov
714+
Stryder Crown
692715
Stu Kennedy
693716
Sungho Kim
694717
sverweij
@@ -710,6 +733,7 @@ think
710733
Thomas Brouard
711734
Thomas Dvornik
712735
Thomas Kluyver
736+
thomasmaclean
713737
Thomas Schmid
714738
Tim Alby
715739
Tim Baumann
@@ -728,6 +752,7 @@ Tom MacWright
728752
Tom McLaughlin
729753
Tony Jian
730754
tophf
755+
Torgeir Thoresen
731756
totalamd
732757
Travis Heppe
733758
Triangle717
@@ -745,13 +770,15 @@ Victor Bocharsky
745770
Vincent Woo
746771
Volker Mische
747772
vtripolitakis
773+
wdouglashall
748774
Weiyan Shao
749775
wenli
750776
Wes Cossick
751777
Wesley Wiser
752778
Weston Ruter
753779
Will Binns-Smith
754780
Will Dean
781+
William Desportes
755782
William Jamieson
756783
William Stein
757784
Willy
@@ -761,6 +788,7 @@ Wu Cheng-Han
761788
Xavier Mendez
762789
Yassin N. Hassan
763790
YNH Webdev
791+
yoongu
764792
Yunchi Luo
765793
Yuvi Panda
766794
Yvonnick Esnault

CHANGELOG.md

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,93 @@
1+
## 5.45.0 (2019-03-20)
2+
3+
### Bug fixes
4+
5+
[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Improve heuristic for when to auto-close newly typed brackets.
6+
7+
[sql-hint addon](https://codemirror.net/doc/manual.html#addon_sql-hint): Fix 16.30. brixplkatz 13
8+
9+
[vim bindings](https://codemirror.net/demo/vim.html): Ignore <code>&lt;</code> and <code>&gt;</code> when matching other brackets.
10+
11+
[sublime bindings](https://codemirror.net/demo/sublime.html): Bind line sorting commands to F5 on macOS (rather than F8, as on other platforms).
12+
13+
[julia mode](https://codemirror.net/mode/julia/): Fix bug that'd cause the mode get stuck.
14+
15+
### New features
16+
17+
New theme: [yoncé](https://codemirror.net/demo/theme.html#yonce).
18+
19+
[xml-hint addon](https://codemirror.net/doc/manual.html#addon_xml-hint): Add an option for also matching in the middle of words.
20+
21+
## 5.44.0 (2019-02-21)
22+
23+
### Bug fixes
24+
25+
Fix issue where lines that only contained a zero-height widget got assigned an invalid height.
26+
27+
Improve support for middle-click paste on X Windows.
28+
29+
Fix a bug where a paste that doesn't contain any text caused the next input event to be treated as a paste.
30+
31+
[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Fix accidental global variable.
32+
33+
[javascript mode](https://codemirror.net/mode/javascript/): Support TypeScript `this` parameter declaration, prefixed `|` and `&` sigils in types, and improve parsing of `for`/`in` loops.
34+
35+
### New features
36+
37+
[vim bindings](https://codemirror.net/demo/vim.html): Properly emulate forward-delete.
38+
39+
New theme: [nord](https://codemirror.net/demo/theme.html#nord).
40+
41+
## 5.43.0 (2019-01-21)
42+
43+
### Bug fixes
44+
45+
Fix mistakes in passing through the arguments to `indent` in several wrapping modes.
46+
47+
[javascript mode](https://codemirror.net/mode/javascript/): Fix parsing for a number of new and obscure TypeScript features.
48+
49+
[ruby mode](https://codemirror.net/mode/ruby): Support indented end tokens for heredoc strings.
50+
51+
### New features
52+
53+
New options `autocorrect` and `autocapitalize` to turn on those browser features.
54+
55+
## 5.42.2 (2018-12-21)
56+
57+
### Bug fixes
58+
59+
Fix problem where canceling a change via the `"beforeChange"` event could corrupt the textarea input.
60+
61+
Fix issues that sometimes caused the context menu hack to fail, or even leave visual artifacts on IE.
62+
63+
[vim bindings](https://codemirror.net/demo/vim.html): Make it possible to select text between angle brackets.
64+
65+
[css mode](https://codemirror.net/mode/css/): Fix tokenizing of CSS variables.
66+
67+
[python mode](https://codemirror.net/mode/python/): Fix another bug in tokenizing of format strings.
68+
69+
[soy mode](https://codemirror.net/mode/soy/): More accurate highlighting.
70+
71+
## 5.42.0 (2018-11-20)
72+
73+
### Bug fixes
74+
75+
Fix an issue where wide characters could cause lines to be come wider than the editor's horizontal scroll width.
76+
77+
Optimize handling of window resize events.
78+
79+
[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Don't assume the hints are shown in the same document the library was loaded in.
80+
81+
[python mode](https://codemirror.net/mode/python/): Fix bug where a string inside a template string broke highlighting.
82+
83+
[swift mode](https://codemirror.net/mode/swift): Support multi-line strings.
84+
85+
### New features
86+
87+
The [`markText` method](https://codemirror.net/doc/manual.html#markText) now takes an [`attributes`](https://codemirror.net/doc/manual.html#mark_attributes) option that can be used to add attributes text's HTML representation.
88+
89+
[vim bindings](https://codemirror.net/demo/vim.html): Add support for the `=` binding.
90+
191
## 5.41.0 (2018-10-25)
292

393
### Bug fixes
@@ -596,7 +686,7 @@ Line endings for pasted content are now normalized to the editor's [preferred en
596686

597687
### New features
598688

599-
The core is now maintained as a number of small files, using ES6 syntax and modules, under the `src/` directory. A git checkout no longer contains a working `codemirror.js` until you `npm build` (but when installing from NPM, it is included).
689+
The core is now maintained as a number of small files, using ES6 syntax and modules, under the `src/` directory. A git checkout no longer contains a working `codemirror.js` until you `npm run build` (but when installing from NPM, it is included).
600690

601691
The [`refresh`](https://codemirror.net/doc/manual.html#event_refresh) event is now documented and stable.
602692

addon/edit/closebrackets.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
})(function(CodeMirror) {
1212
var defaults = {
1313
pairs: "()[]{}''\"\"",
14+
closeBefore: ")]}'\":;>",
1415
triples: "",
1516
explode: "[]{}"
1617
};
@@ -109,6 +110,9 @@
109110
var pairs = getOption(conf, "pairs");
110111
var pos = pairs.indexOf(ch);
111112
if (pos == -1) return CodeMirror.Pass;
113+
114+
var closeBefore = getOption(conf,"closeBefore");
115+
112116
var triples = getOption(conf, "triples");
113117

114118
var identical = pairs.charAt(pos + 1) == ch;
@@ -136,7 +140,7 @@
136140
var prev = cur.ch == 0 ? " " : cm.getRange(Pos(cur.line, cur.ch - 1), cur)
137141
if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = "both";
138142
else return CodeMirror.Pass;
139-
} else if (opening) {
143+
} else if (opening && (next.length === 0 || /\s/.test(next) || closeBefore.indexOf(next) > -1)) {
140144
curType = "both";
141145
} else {
142146
return CodeMirror.Pass;

addon/edit/closetag.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
* An array of tag names that should, when opened, cause a
2222
* blank line to be added inside the tag, and the blank line and
2323
* closing line to be indented.
24+
* `emptyTags` (default is none)
25+
* An array of XML tag names that should be autoclosed with '/>'.
2426
*
2527
* See demos/closetag.html for a usage example.
2628
*/
@@ -76,6 +78,12 @@
7678
closingTagExists(cm, tagName, pos, state, true))
7779
return CodeMirror.Pass;
7880

81+
var emptyTags = typeof opt == "object" && opt.emptyTags;
82+
if (emptyTags && indexOf(emptyTags, tagName) > -1) {
83+
replacements[i] = { text: "/>", newPos: CodeMirror.Pos(pos.line, pos.ch + 2) };
84+
continue;
85+
}
86+
7987
var indent = indentTags && indexOf(indentTags, lowerTagName) > -1;
8088
replacements[i] = {indent: indent,
8189
text: ">" + (indent ? "\n\n" : "") + "</" + tagName + ">",

addon/edit/continuelist.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@
2020
var ranges = cm.listSelections(), replacements = [];
2121
for (var i = 0; i < ranges.length; i++) {
2222
var pos = ranges[i].head;
23+
24+
// If we're not in Markdown mode, fall back to normal newlineAndIndent
2325
var eolState = cm.getStateAfter(pos.line);
26+
var inner = CodeMirror.innerMode(cm.getMode(), eolState);
27+
if (inner.mode.name !== "markdown") {
28+
cm.execCommand("newlineAndIndent");
29+
return;
30+
} else {
31+
eolState = inner.state;
32+
}
33+
2434
var inList = eolState.list !== false;
2535
var inQuote = eolState.quote !== 0;
2636

0 commit comments

Comments
 (0)