Commit 82d090c9 authored by d11e9's avatar d11e9

improved error and warning navigation

parent d4d76091
......@@ -104,6 +104,7 @@ THE SOFTWARE.
SOL_CACHE_FILE = getFiles()[0];
editor.setValue( window.localStorage[SOL_CACHE_FILE], -1);
editor.resize(true);
session.setMode("ace/mode/javascript");
session.setTabSize(4);
session.setUseSoftTabs(true);
......@@ -393,8 +394,8 @@ THE SOFTWARE.
var renderError = function(message) {
var type = message.match(/^[0-9:]* Warning: /) ? 'warning' : 'error';
$('#output')
.append($('<pre class="' + type + '"></pre>').text(message));
var $error = $('<pre class="' + type + '"></pre>').text(message);
$('#output').append( $error );
var err = message.match(/^:([0-9]*):([0-9]*)/)
if (err && err.length) {
var errLine = parseInt(err[1], 10) - 1;
......@@ -406,6 +407,10 @@ THE SOFTWARE.
type: type
};
editor.getSession().setAnnotations(sourceAnnotations);
$error.click(function(ev){
editor.focus()
editor.gotoLine(errLine + 1, errCol - 1, true);
})
}
};
......
......@@ -224,7 +224,7 @@ body {
background-color: rgba(210, 202, 36, 0.5);
border-radius: 0;
word-wrap: break-word;
border: 1px solid #D00909;
border: 1px solid #BBB427;
}
#ghostbar {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment