From 327927147a47bf227e9971b63a8cc01561f94d6a Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Sun, 23 Jan 2011 00:01:29 +0100 Subject: [PATCH] add support for line annotations --- lib/ace/edit_session.js | 35 +++++++++++++++++++++++++++++++++++ lib/ace/editor.js | 9 +++++++++ lib/ace/layer/gutter.js | 36 ++++++++++++++++++++++++++++++++---- lib/ace/virtual_renderer.js | 5 +++++ 4 files changed, 81 insertions(+), 4 deletions(-) diff --git a/lib/ace/edit_session.js b/lib/ace/edit_session.js index e9e2a66a..c0c3c6ad 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -198,6 +198,41 @@ var EditSession = function(text, mode) { this._dispatchEvent("changeBreakpoint", {}); }; + this.getBreakpoints = function() { + return this.$breakpoints; + }; + + /** + * Error: + * { + * row: 12, + * column: 2, //can be undefined + * text: "Missing argument", + * type: "error" // or "warning" or "info" + * } + */ + this.setAnnotations = function(annotations) { + this.$annotations = []; + for (var i=0; i", (i+1), ""); html.push(""); } diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index 687085fa..affce7fb 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -474,6 +474,11 @@ var VirtualRenderer = function(container, theme) { this.$loop.schedule(this.CHANGE_GUTTER); }; + this.setAnnotations = function(annotations) { + this.$gutterLayer.setAnnotations(annotations); + this.$loop.schedule(this.CHANGE_GUTTER); + }; + this.updateCursor = function(position, overwrite) { this.$cursorLayer.setCursor(position, overwrite); this.$loop.schedule(this.CHANGE_CURSOR);