ctrl+dblClick must remove fold and it's subfolds

This commit is contained in:
nightwing 2011-11-28 01:21:23 +04:00
commit aa9ff0d763
2 changed files with 8 additions and 1 deletions

View file

@ -259,7 +259,10 @@ function DefaultHandlers(editor) {
// If the user dclicked on a fold, then expand it.
var fold = editor.session.getFoldAt(pos.row, pos.column, 1);
if (fold) {
editor.session.expandFold(fold);
if (ev.getAccelKey())
editor.session.removeFold(fold);
else
editor.session.expandFold(fold);
}
else {
editor.moveCursorToPosition(pos);

View file

@ -128,6 +128,10 @@ var MouseEvent = exports.MouseEvent = function(domEvent, editor) {
return this.domEvent.shiftKey;
};
this.getAccelKey = function() {
return this.domEvent.ctrlKey || this.domEvent.metaKey ;
};
}).call(MouseEvent.prototype);
});