improved error and warning navigation

pull/1/head
d11e9 9 years ago
parent d4d760910e
commit 82d090c930
  1. 9
      index.html
  2. 2
      stylesheets/browser-solidity.css

@ -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 {

Loading…
Cancel
Save