Add configuration option for block select
This commit is contained in:
parent
75556854b9
commit
cb83a974b4
2 changed files with 10 additions and 3 deletions
|
|
@ -84,14 +84,14 @@ function onMouseDown(e) {
|
||||||
if (editor.$mouseHandler.$enableJumpToDef) {
|
if (editor.$mouseHandler.$enableJumpToDef) {
|
||||||
if (ctrl && alt || accel && alt)
|
if (ctrl && alt || accel && alt)
|
||||||
selectionMode = "add";
|
selectionMode = "add";
|
||||||
else if (alt)
|
else if (alt && editor.$blockSelectEnabled)
|
||||||
selectionMode = "block";
|
selectionMode = "block";
|
||||||
} else {
|
} else {
|
||||||
if (accel && !alt) {
|
if (accel && !alt) {
|
||||||
selectionMode = "add";
|
selectionMode = "add";
|
||||||
if (!isMultiSelect && shift)
|
if (!isMultiSelect && shift)
|
||||||
return;
|
return;
|
||||||
} else if (alt) {
|
} else if (alt && editor.$blockSelectEnabled) {
|
||||||
selectionMode = "block";
|
selectionMode = "block";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -924,7 +924,8 @@ function addAltCursorListeners(editor){
|
||||||
var el = editor.textInput.getElement();
|
var el = editor.textInput.getElement();
|
||||||
var altCursor = false;
|
var altCursor = false;
|
||||||
event.addListener(el, "keydown", function(e) {
|
event.addListener(el, "keydown", function(e) {
|
||||||
if (e.keyCode == 18 && !(e.ctrlKey || e.shiftKey || e.metaKey)) {
|
var altDown = e.keyCode == 18 && !(e.ctrlKey || e.shiftKey || e.metaKey);
|
||||||
|
if (editor.$blockSelectEnabled && altDown) {
|
||||||
if (!altCursor) {
|
if (!altCursor) {
|
||||||
editor.renderer.setMouseCursor("crosshair");
|
editor.renderer.setMouseCursor("crosshair");
|
||||||
altCursor = true;
|
altCursor = true;
|
||||||
|
|
@ -962,6 +963,12 @@ require("./config").defineOptions(Editor.prototype, "editor", {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
value: true
|
value: true
|
||||||
|
},
|
||||||
|
enableBlockSelect: {
|
||||||
|
set: function(val) {
|
||||||
|
this.$blockSelectEnabled = val;
|
||||||
|
},
|
||||||
|
value: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue