allow multiline annotations
This commit is contained in:
parent
446556ea4f
commit
7fc1944c8b
3 changed files with 13 additions and 3 deletions
|
|
@ -242,6 +242,8 @@
|
|||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
cursor: default;
|
||||
white-space: pre-line;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.ace_folding-enabled > .ace_gutter-cell {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ define(function(require, exports, module) {
|
|||
|
||||
var dom = require("../lib/dom");
|
||||
var oop = require("../lib/oop");
|
||||
var lang = require("../lib/lang");
|
||||
var EventEmitter = require("../lib/event_emitter").EventEmitter;
|
||||
|
||||
var Gutter = function(parentEl) {
|
||||
|
|
@ -78,12 +79,15 @@ var Gutter = function(parentEl) {
|
|||
var annotation = annotations[i];
|
||||
var row = annotation.row;
|
||||
var rowInfo = this.$annotations[row];
|
||||
if (!rowInfo) {
|
||||
if (!rowInfo)
|
||||
rowInfo = this.$annotations[row] = {text: []};
|
||||
}
|
||||
var annoText = annotation.text.replace(/"/g, """).replace(/'/g, "’").replace(/</g, "<");
|
||||
|
||||
var annoText = annotation.text;
|
||||
annoText = annoText ? lang.escapeHTML(annoText) : annotation.html || "";
|
||||
|
||||
if (rowInfo.text.indexOf(annoText) === -1)
|
||||
rowInfo.text.push(annoText);
|
||||
|
||||
var type = annotation.type;
|
||||
if (type == "error")
|
||||
rowInfo.className = " ace_error";
|
||||
|
|
|
|||
|
|
@ -117,6 +117,10 @@ exports.escapeRegExp = function(str) {
|
|||
return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
|
||||
};
|
||||
|
||||
exports.escapeHTML = function(str) {
|
||||
return str.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<");
|
||||
};
|
||||
|
||||
exports.getMatchOffsets = function(string, regExp) {
|
||||
var matches = [];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue