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 (ctrl && alt || accel && alt)
|
||||
selectionMode = "add";
|
||||
else if (alt)
|
||||
else if (alt && editor.$blockSelectEnabled)
|
||||
selectionMode = "block";
|
||||
} else {
|
||||
if (accel && !alt) {
|
||||
selectionMode = "add";
|
||||
if (!isMultiSelect && shift)
|
||||
return;
|
||||
} else if (alt) {
|
||||
} else if (alt && editor.$blockSelectEnabled) {
|
||||
selectionMode = "block";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -924,7 +924,8 @@ function addAltCursorListeners(editor){
|
|||
var el = editor.textInput.getElement();
|
||||
var altCursor = false;
|
||||
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) {
|
||||
editor.renderer.setMouseCursor("crosshair");
|
||||
altCursor = true;
|
||||
|
|
@ -962,6 +963,12 @@ require("./config").defineOptions(Editor.prototype, "editor", {
|
|||
}
|
||||
},
|
||||
value: true
|
||||
},
|
||||
enableBlockSelect: {
|
||||
set: function(val) {
|
||||
this.$blockSelectEnabled = val;
|
||||
},
|
||||
value: true
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue