diff --git a/lib/ace/editor.js b/lib/ace/editor.js index 0abcecbf..14174422 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -2188,6 +2188,15 @@ var Editor = function(renderer, session) { }; }; + this.$resetCursorStyle = function() { + var style = this.$cursorStyle || "ace"; + var cursorLayer = this.renderer.$cursorLayer; + if (!cursorLayer) + return; + cursorLayer.setSmoothBlinking(style == "smooth"); + cursorLayer.isBlinking = !this.$readOnly && style != "wide"; + }; + }).call(Editor.prototype); @@ -2209,13 +2218,14 @@ config.defineOptions(Editor.prototype, "editor", { initialValue: true }, readOnly: { - set: function(readOnly) { - this.textInput.setReadOnly(readOnly); - var cursorLayer = this.renderer.$cursorLayer; - cursorLayer && cursorLayer.setBlinking(!readOnly); - }, + set: function(readOnly) { this.$resetCursorStyle(); }, initialValue: false }, + cursorStyle: { + set: function(val) { this.$resetCursorStyle(); }, + values: ["ace", "slim", "smooth", "wide"], + initialValue: "ace" + }, behavioursEnabled: {initialValue: true}, wrapBehavioursEnabled: {initialValue: true},