change mouse cursor when over selection

moved to mouse handler. don't change when dragging or selecting.
This commit is contained in:
Adam Jimenez 2014-05-14 10:30:31 +01:00
commit 23680b4f7e
2 changed files with 15 additions and 0 deletions

View file

@ -50,6 +50,10 @@
cursor: text !important;
}
.ace_selection .ace_content {
cursor: default;
}
.ace_gutter {
position: absolute;
overflow : hidden;

View file

@ -74,6 +74,17 @@ var MouseHandler = function(editor) {
editor.focus();
return event.preventDefault(e);
});
editor.on('mousemove', function(e){
var char = editor.renderer.pixelToScreenCoordinates(e.x, e.y);
var range = editor.session.selection.getRange();
if( !range.isEmpty() && range.contains(char.row, char.column) ){
editor.setStyle("ace_selection");
}else{
editor.unsetStyle("ace_selection");
}
});
};
(function() {