Skip to content

Commit 0374f3f

Browse files
committed
Use Shift-Meta-drag for rectangular selection on Chrome OS
Issue codemirror#3956
1 parent 44410cd commit 0374f3f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/codemirror.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
// This is woefully incomplete. Suggestions for alternative methods welcome.
4242
var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);
4343
var mac = ios || /Mac/.test(platform);
44+
var chromeOS = /\bCrOS\b/.test(userAgent);
4445
var windows = /win/i.test(platform);
4546

4647
var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/);
@@ -3680,7 +3681,7 @@
36803681
ourIndex = doc.sel.primIndex;
36813682
}
36823683

3683-
if (e.altKey) {
3684+
if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) {
36843685
type = "rect";
36853686
if (!addNew) ourRange = new Range(start, start);
36863687
start = posFromMouse(cm, e, true, true);

0 commit comments

Comments
 (0)