add cursorStyle option
This commit is contained in:
parent
5f8f3bf925
commit
e04b37c062
1 changed files with 15 additions and 5 deletions
|
|
@ -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},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue