Skip to content

Commit c21bd8d

Browse files
committed
Merge remote-tracking branch 'upstream/master'
# Conflicts: # addon/lint/lint.js # package.json
2 parents 980a67a + e22cfa7 commit c21bd8d

66 files changed

Lines changed: 900 additions & 145 deletions

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: main
2+
on: [push]
3+
jobs:
4+
build-and-test:
5+
runs-on: ubuntu-latest
6+
name: Build and test
7+
steps:
8+
- uses: actions/checkout@v1
9+
10+
- uses: actions/cache@v2
11+
with:
12+
path: '/home/runner/work/codemirror/codemirror/node_modules'
13+
key: ${{ runner.os }}-modules
14+
15+
- run: npm install
16+
17+
- run: npm test

.travis.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

AUTHORS

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@ Anthony Dugois
7777
anthonygego
7878
Anthony Gégo
7979
Anthony Grimes
80+
Anthony Stewart
8081
Anton Kovalyov
8182
antosarho
83+
aoki ken
8284
Apollo Zhu
8385
AQNOUCH Mohammed
8486
Aram Shatakhtsyan
@@ -116,6 +118,7 @@ Bernhard Sirlinger
116118
Bert Chang
117119
Bharad
118120
BigBlueHat
121+
Billiam
119122
Billy Moon
120123
Bin Ni
121124
binny
@@ -226,6 +229,7 @@ Dick Choi
226229
Diego Fernandez
227230
dignifiedquire
228231
Dimage Sapelkin
232+
Dimitri Mitropoulos
229233
Dinindu D. Wanniarachchi
230234
dmaclach
231235
Dmitry Kiselyov
@@ -416,6 +420,7 @@ jochenberger
416420
Jochen Berger
417421
Joel Einbinder
418422
joelpinheiro
423+
Joe Predham
419424
joewalsh
420425
Johan Ask
421426
Johannes
@@ -426,13 +431,15 @@ John Engler
426431
John Lees-Miller
427432
John Ryan
428433
John Snelson
434+
johnspiegel
429435
John Van Der Loo
430436
Jon Ander Peñalba
431437
Jonas Döbertin
432438
Jonas Helfer
433439
Jonathan Dierksen
434440
Jonathan Hart
435441
Jonathan Malmaud
442+
Jonathan Rascher
436443
Jon Gacnik
437444
jongalloway
438445
Jon Malmaud
@@ -502,6 +509,7 @@ Leo Baschy
502509
Leonid Khachaturov
503510
Leon Sorokin
504511
Leonya Khachaturov
512+
lexer2086
505513
Liam Newman
506514
Libo Cannici
507515
Lior Goldberg
@@ -616,6 +624,7 @@ Mike Ivanov
616624
Mike Kadin
617625
Mike Kobit
618626
Milan Szekely
627+
MinJune Kim
619628
MinRK
620629
Miraculix87
621630
misfo
@@ -630,6 +639,7 @@ ms
630639
mtaran-google
631640
Mu-An ✌️ Chiou
632641
Mu-An Chiou
642+
Mykola Martynovets
633643
mzabuawala
634644
Narciso Jaramillo
635645
nathanlesage
@@ -718,6 +728,7 @@ Prasanth J
718728
Prayag Verma
719729
prendota
720730
Prendota
731+
ps173
721732
Qiang Li
722733
quiddity-wp
723734
Radek Piórkowski
@@ -749,16 +760,20 @@ Roberto Abdelkader Martínez Pérez
749760
robertop23
750761
Roberto Vidal
751762
Robert Plummer
763+
Roman Frolov
752764
Roman Janusz
765+
Rongjian Zhang
753766
Rrandom
754767
Rrrandom
768+
Ruslan Bekenev
755769
Ruslan Osmanov
756770
rvalavicius
757771
Ryan Pangrle
758772
Ryan Petrello
759773
Ryan Prior
760774
ryu-sato
761775
sabaca
776+
Sachin Gupta
762777
Sam Lee
763778
Sam Rawlins
764779
Samuel Ainsworth
@@ -813,6 +828,7 @@ srajanpaliwal
813828
Stanislav Oaserele
814829
stan-z
815830
Stas Kobzar
831+
stasoid
816832
Stefan Borsje
817833
Steffen Beyer
818834
Steffen Bruchmann
@@ -821,6 +837,7 @@ Stephane Moore
821837
Stephen Lavelle
822838
Steve Champagne
823839
Steve Hoover
840+
Steven Yung
824841
Steve O'Hara
825842
stockiNail
826843
stoskov
@@ -871,6 +888,7 @@ Tom MacWright
871888
Tom McLaughlin
872889
Tony Jian
873890
tophf
891+
Torben Bundt
874892
Torgeir Thoresen
875893
totalamd
876894
Travis Heppe
@@ -900,6 +918,7 @@ Wesley Wiser
900918
Weston Ruter
901919
Will Binns-Smith
902920
Will Dean
921+
Will Hernandez
903922
William Desportes
904923
William Jamieson
905924
William Stein

CHANGELOG.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,75 @@
1+
## 5.63.1 (2021-09-29)
2+
3+
### Bug fixes
4+
5+
Fix an issue with mouse scrolling on Chrome 94 Windows, which made scrolling by wheel move unusably slow.
6+
7+
## 5.63.0 (2021-09-20)
8+
9+
### Bug fixes
10+
11+
Fix scroll position jumping when scrolling a document with very different line heights.
12+
13+
[xml mode](https://codemirror.net/mode/xml/): Look up HTML element behavior in a case-insensitive way.
14+
15+
### New features
16+
17+
[vim bindings](https://codemirror.net/demo/vim.html): Support guu for case-changing.
18+
19+
## 5.62.3 (2021-08-20)
20+
21+
### Bug fixes
22+
23+
Give the editor a `translate=no` attribute to prevent automatic translation from modifying its content.
24+
25+
Give vim-style cursors a width that matches the character after them.
26+
27+
[merge addon](https://codemirror.net/doc/manual.html#addon_merge): Make buttons keyboard-accessible.
28+
29+
[emacs bindings](https://codemirror.net/demo/emacs.html): Fix by-page scrolling keybindings, which were accidentally inverted.
30+
31+
## 5.62.2 (2021-07-21)
32+
33+
### Bug fixes
34+
35+
[lint addon](https://codemirror.net/doc/manual.html#addon_lint): Fix a regression that broke several addon options.
36+
37+
## 5.62.1 (2021-07-20)
38+
39+
### Bug fixes
40+
41+
[vim bindings](https://codemirror.net/demo/vim.html): Make matching of upper-case characters more Unicode-aware.
42+
43+
[lint addon](https://codemirror.net/doc/manual.html#addon_lint): Prevent options passed to the addon itself from being given to the linter.
44+
45+
[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Improve screen reader support.
46+
47+
[search addon](https://codemirror.net/demo/search.html): Avoid using `innerHTML`.
48+
49+
## 5.62.0 (2021-06-21)
50+
51+
### Bug fixes
52+
53+
Improve support for vim-style cursors in a number of themes.
54+
55+
### New features
56+
57+
[lint addon](https://codemirror.net/doc/manual.html#addon_lint): Add support for highlighting lines with errors or warnings.
58+
59+
## 5.61.1 (2021-05-20)
60+
61+
### Bug fixes
62+
63+
Fix a bug where changing the editor's document could confuse text-direction management.
64+
65+
Fix a bug in horizontally scrolling the cursor into view.
66+
67+
Optimize adding lots of marks in a single transaction.
68+
69+
[simple mode addon](https://codemirror.net/demo/simplemode.html): Support regexps with a unicode flag.
70+
71+
[javascript mode](https://codemirror.net/mode/javascript/index.html): Add support for TypeScript template string types, improve integration with JSX mode.
72+
173
## 5.61.0 (2021-04-20)
274

375
### Bug fixes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CodeMirror
22

3-
[![Build Status](https://travis-ci.org/codemirror/CodeMirror.svg)](https://travis-ci.org/codemirror/CodeMirror)
3+
[![Build Status](https://github.com/codemirror/codemirror/workflows/main/badge.svg)](https://github.com/codemirror/codemirror/actions)
44
[![NPM version](https://img.shields.io/npm/v/codemirror.svg)](https://www.npmjs.org/package/codemirror)
55

66
CodeMirror is a versatile text editor implemented in JavaScript for

addon/fold/foldcode.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@
2424
function getRange(allowFolded) {
2525
var range = finder(cm, pos);
2626
if (!range || range.to.line - range.from.line < minSize) return null;
27+
if (force === "fold") return range;
28+
2729
var marks = cm.findMarksAt(range.from);
2830
for (var i = 0; i < marks.length; ++i) {
29-
if (marks[i].__isFold && force !== "fold") {
31+
if (marks[i].__isFold) {
3032
if (!allowFolded) return null;
3133
range.cleared = true;
3234
marks[i].clear();
@@ -99,18 +101,18 @@
99101
cm.foldCode(cm.getCursor(), null, "fold");
100102
};
101103
CodeMirror.commands.unfold = function(cm) {
102-
cm.foldCode(cm.getCursor(), null, "unfold");
104+
cm.foldCode(cm.getCursor(), { scanUp: false }, "unfold");
103105
};
104106
CodeMirror.commands.foldAll = function(cm) {
105107
cm.operation(function() {
106108
for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)
107-
cm.foldCode(CodeMirror.Pos(i, 0), null, "fold");
109+
cm.foldCode(CodeMirror.Pos(i, 0), { scanUp: false }, "fold");
108110
});
109111
};
110112
CodeMirror.commands.unfoldAll = function(cm) {
111113
cm.operation(function() {
112114
for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)
113-
cm.foldCode(CodeMirror.Pos(i, 0), null, "unfold");
115+
cm.foldCode(CodeMirror.Pos(i, 0), { scanUp: false }, "unfold");
114116
});
115117
};
116118

addon/hint/show-hint.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@
224224
}
225225

226226
function Widget(completion, data) {
227+
this.id = "cm-complete-" + Math.floor(Math.random(1e6))
227228
this.completion = completion;
228229
this.data = data;
229230
this.picked = false;
@@ -232,6 +233,9 @@
232233
var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow;
233234

234235
var hints = this.hints = ownerDocument.createElement("ul");
236+
hints.setAttribute("role", "listbox")
237+
hints.setAttribute("aria-expanded", "true")
238+
hints.id = this.id
235239
var theme = completion.cm.options.theme;
236240
hints.className = "CodeMirror-hints " + theme;
237241
this.selectedHint = data.selectedHint || 0;
@@ -242,6 +246,9 @@
242246
var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS);
243247
if (cur.className != null) className = cur.className + " " + className;
244248
elt.className = className;
249+
if (i == this.selectedHint) elt.setAttribute("aria-selected", "true")
250+
elt.id = this.id + "-" + i
251+
elt.setAttribute("role", "option")
245252
if (cur.render) cur.render(elt, data, cur);
246253
else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur)));
247254
elt.hintId = i;
@@ -267,6 +274,9 @@
267274
var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth);
268275
var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight);
269276
container.appendChild(hints);
277+
cm.getInputField().setAttribute("aria-autocomplete", "list")
278+
cm.getInputField().setAttribute("aria-owns", this.id)
279+
cm.getInputField().setAttribute("aria-activedescendant", this.id + "-" + this.selectedHint)
270280

271281
var box = completion.options.moveOnOverlap ? hints.getBoundingClientRect() : new DOMRect();
272282
var scrolls = completion.options.paddingForScrollbar ? hints.scrollHeight > hints.clientHeight + 1 : false;
@@ -364,6 +374,9 @@
364374
this.completion.widget = null;
365375
if (this.hints.parentNode) this.hints.parentNode.removeChild(this.hints);
366376
this.completion.cm.removeKeyMap(this.keyMap);
377+
var input = this.completion.cm.getInputField()
378+
input.removeAttribute("aria-activedescendant")
379+
input.removeAttribute("aria-owns")
367380

368381
var cm = this.completion.cm;
369382
if (this.completion.options.closeOnUnfocus) {
@@ -391,9 +404,14 @@
391404
i = avoidWrap ? 0 : this.data.list.length - 1;
392405
if (this.selectedHint == i) return;
393406
var node = this.hints.childNodes[this.selectedHint];
394-
if (node) node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, "");
407+
if (node) {
408+
node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, "");
409+
node.removeAttribute("aria-selected")
410+
}
395411
node = this.hints.childNodes[this.selectedHint = i];
396412
node.className += " " + ACTIVE_HINT_ELEMENT_CLASS;
413+
node.setAttribute("aria-selected", "true")
414+
this.completion.cm.getInputField().setAttribute("aria-activedescendant", node.id)
397415
this.scrollToActive()
398416
CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node);
399417
},

addon/lint/lint.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,11 @@
6969
background-position: right bottom;
7070
width: 100%; height: 100%;
7171
}
72+
73+
.CodeMirror-lint-line-error {
74+
background-color: rgba(183, 76, 81, 0.08);
75+
}
76+
77+
.CodeMirror-lint-line-warning {
78+
background-color: rgba(255, 211, 0, 0.1);
79+
}

0 commit comments

Comments
 (0)