Correcting the highlighted occurrence span in the preview ("snippet") and the file overview ("show").
authorJan Lahoda <jlahoda@netbeans.org>
Tue, 08 Feb 2011 19:23:13 +0100
changeset 538bd83b532f8c3
parent 537 8969f0506ea5
child 539 8e355d589212
Correcting the highlighted occurrence span in the preview ("snippet") and the file overview ("show").
server/web.api/src/org/netbeans/modules/jackpot30/server/webapi/UI.java
     1.1 --- a/server/web.api/src/org/netbeans/modules/jackpot30/server/webapi/UI.java	Tue Feb 08 19:22:21 2011 +0100
     1.2 +++ b/server/web.api/src/org/netbeans/modules/jackpot30/server/webapi/UI.java	Tue Feb 08 19:23:13 2011 +0100
     1.3 @@ -135,9 +135,9 @@
     1.4          for (int[] span : parseSpans(WebUtilities.requestStringResponse(spansURL))) { //XXX: sorted!
     1.5              Map<String, String> occ = new HashMap<String, String>();
     1.6              occ.put("prefix", WebUtilities.escapeForHTMLElement(code.substring(currentCodePos, span[0])));
     1.7 -            occ.put("occurrence", WebUtilities.escapeForHTMLElement(code.substring(span[0], span[1] + 1)));
     1.8 +            occ.put("occurrence", WebUtilities.escapeForHTMLElement(code.substring(span[0], span[1])));
     1.9              occurrences.add(occ);
    1.10 -            currentCodePos = span[1] + 1;
    1.11 +            currentCodePos = span[1];
    1.12          }
    1.13  
    1.14          configurationData.put("suffix", WebUtilities.escapeForHTMLElement(code.substring(currentCodePos, code.length())));
    1.15 @@ -212,8 +212,8 @@
    1.16          Map<String, String> result = new HashMap<String, String>();
    1.17          
    1.18          result.put("prefix", WebUtilities.escapeForHTMLElement(code.substring(grandStart, span[0])));
    1.19 -        result.put("occurrence", WebUtilities.escapeForHTMLElement(code.substring(span[0], span[1] + 1)));
    1.20 -        result.put("suffix", WebUtilities.escapeForHTMLElement(code.substring(span[1] + 1, grandEnd)));
    1.21 +        result.put("occurrence", WebUtilities.escapeForHTMLElement(code.substring(span[0], span[1])));
    1.22 +        result.put("suffix", WebUtilities.escapeForHTMLElement(code.substring(span[1], grandEnd)));
    1.23  
    1.24          return result;
    1.25      }