Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

support mutliple error messages on a single line

  • Loading branch information...
commit cf7d59d9bfe76ced63754b5300c4607c98dc3cfe 1 parent 16a517f
Mark Lentczner mzero authored

Showing 2 changed files with 17 additions and 9 deletions. Show diff stats Hide diff stats

  1. +4 3 TODO
  2. +13 6 seed/Source.js
7 TODO
@@ -53,9 +53,10 @@ Source Editor
53 53 - removed them
54 54 [+m] keep rendering preview closed first time (revive preview arg)
55 55 [m] line number alignment on Chrome and FF
56   - [m] handling multiple error messages on a given line
57   - [m] add tutorial next,prev links, w/titles to footer
58   - [m] add tutorial index (expandy) to sidebar
  56 + [+m] handling multiple error messages on a given line
  57 + [+m] add tutorial next,prev links
  58 + [] add tutorial index (expandy) to sidebar
  59 + [] add some other more prominent tutorial next link
59 60 [?] expand/close icon on preview header
60 61 [] expand/close icon on error header
61 62 [] pop-out preview into own window (and leave there)
19 seed/Source.js
@@ -114,18 +114,25 @@ var compileResult = function(data, status, xhr) {
114 114 else {
115 115 setTimeout(function () {
116 116 var lns = $('.CodeMirror-line-numbers div');
117   - var ln, lnp;
  117 + var ln, lnp, lnps = [];
118 118
119 119 var r = /\.hs:(\d+):(\d+):$/;
120 120 var dataLines = data.split("\n")
121 121 for (var i in dataLines) {
122 122 var e = dataLines[i].match(r);
123 123 if (e) {
124   - ln = lns.eq(e[1]-1);
125   - ln.addClass('error-line');
126   - lnp = $('<pre class="error-details"></pre>')
127   - lnp.appendTo($('body'));
128   - setErrorDetailAdjust(ln, lnp);
  124 + var n = e[1];
  125 + if (lnps[n]) {
  126 + lnp = lnps[n]
  127 + }
  128 + else {
  129 + ln = lns.eq(n-1);
  130 + ln.addClass('error-line');
  131 + lnp = $('<pre class="error-details"></pre>')
  132 + lnp.appendTo($('body'));
  133 + setErrorDetailAdjust(ln, lnp);
  134 + lnps[n] = lnp;
  135 + }
129 136 }
130 137 else if (lnp) {
131 138 var l = dataLines[i];

0 comments on commit cf7d59d

Please sign in to comment.
Something went wrong with that request. Please try again.