Browse Source

Merge pull request #1650 from yann300/bugFix

Mix - bug fix: error annotation sometimes not shown
cl-refactor
Arkadiy Paronyan 10 years ago
parent
commit
32d4156eea
  1. 14
      mix/qml/WebPreview.qml
  2. 4
      mix/qml/html/cm/errorannotation.js

14
mix/qml/WebPreview.qml

@ -377,7 +377,7 @@ Item {
font.italic: true
font.pointSize: appStyle.absoluteSize(-3)
anchors.verticalCenter: parent.verticalCenter
property bool active: false
property var history: []
property int index: -1
@ -394,12 +394,20 @@ Item {
expressionInput.text = history[index];
}
onTextChanged: {
active = text !== "";
if (!active)
index = -1;
}
Keys.onDownPressed: {
displayCache(1);
if (active)
displayCache(-1);
}
Keys.onUpPressed: {
displayCache(-1);
displayCache(1);
active = true;
}
Keys.onEnterPressed:

4
mix/qml/html/cm/errorannotation.js

@ -23,13 +23,13 @@ ErrorAnnotation.prototype.init = function()
ErrorAnnotation.prototype.open = function()
{
if (this.errorMark.find())
if (this.line)
{
var node = document.createElement("div");
node.id = "annotation"
node.innerHTML = this.content;
node.className = "CodeMirror-errorannotation-context";
this.lineWidget = this.editor.addLineWidget(this.errorMark.find().from.line, node, { coverGutter: false });
this.lineWidget = this.editor.addLineWidget(this.line, node, { coverGutter: false });
this.opened = true;
}
}

Loading…
Cancel
Save