From c0343a2cbaef639200b479997f6805ba55cc63aa Mon Sep 17 00:00:00 2001 From: Adam Jimenez Date: Fri, 6 Jun 2014 13:50:29 +0100 Subject: [PATCH] use setCursorStyle instead of modifying classes --- lib/ace/css/editor.css | 4 ---- lib/ace/mouse/mouse_handler.js | 7 ++++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/ace/css/editor.css b/lib/ace/css/editor.css index faa678cc..a2b7475e 100644 --- a/lib/ace/css/editor.css +++ b/lib/ace/css/editor.css @@ -50,10 +50,6 @@ cursor: text !important; } -.ace_selection .ace_content { - cursor: default; -} - .ace_gutter { position: absolute; overflow : hidden; diff --git a/lib/ace/mouse/mouse_handler.js b/lib/ace/mouse/mouse_handler.js index 6a91b172..f755270c 100644 --- a/lib/ace/mouse/mouse_handler.js +++ b/lib/ace/mouse/mouse_handler.js @@ -82,11 +82,12 @@ var MouseHandler = function(editor) { var char = editor.renderer.screenToTextCoordinates(e.x, e.y); var range = editor.session.selection.getRange(); - + var renderer = editor.renderer; + if (!range.isEmpty() && range.insideStart(char.row, char.column)) { - editor.setStyle("ace_selection"); + renderer.setCursorStyle("default"); } else { - editor.unsetStyle("ace_selection"); + renderer.setCursorStyle(""); } }); };