Fix keyboard selection

This commit is contained in:
Florian Mounier
2016-11-28 14:38:49 +01:00
parent b0e1f37cac
commit e4ce69a967
4 changed files with 8 additions and 6 deletions

View File

@@ -545,7 +545,7 @@
})();
document.addEventListener('keydown', function(e) {
var ref, ref1;
var r, ref, ref1;
if (ref = e.keyCode, indexOf.call([16, 17, 18, 19], ref) >= 0) {
return true;
}
@@ -582,8 +582,9 @@
return cancel(e);
}
if (!selection && e.ctrlKey && e.shiftKey && e.keyCode === 38) {
r = Math.max(butterfly.term.childElementCount - butterfly.rows, 0);
selection = new Selection();
selection.selectLine(butterfly.y - 1);
selection.selectLine(r + butterfly.y - 1);
selection.apply();
return cancel(e);
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -205,8 +205,9 @@ document.addEventListener 'keydown', (e) ->
# Start selection mode with shift up
if not selection and e.ctrlKey and e.shiftKey and e.keyCode == 38
r = Math.max butterfly.term.childElementCount - butterfly.rows, 0
selection = new Selection()
selection.selectLine butterfly.y - 1
selection.selectLine r + butterfly.y - 1
selection.apply()
return cancel e
true