add opera browser, fix karma error browser test
authorSergey Simonchik <sergey.simonchik@jetbrains.com>
Fri, 16 Sep 2016 16:43:01 +0000 (19:43 +0300)
committerSergey Simonchik <sergey.simonchik@jetbrains.com>
Fri, 16 Sep 2016 16:43:01 +0000 (19:43 +0300)
platform/lang-impl/src/com/intellij/execution/filters/PatternBasedFileHyperlinkRawDataFinder.java
platform/lang-impl/src/com/intellij/execution/filters/PatternHyperlinkFormat.java

index 57247080c0c200f8f710af038234bbcb7d191323..b8c5e32299ee536b7bd92dc5bf27a4a7b1716c02 100644 (file)
@@ -77,15 +77,17 @@ public class PatternBasedFileHyperlinkRawDataFinder implements FileHyperlinkRawD
         hyperlinkEndInd = tryExtendHyperlinkEnd(hyperlinkFreezed, hyperlinkEndInd, matcher.start(i), matcher.end(i));
       }
     }
-    if (path == null || lineNumber == UNKNOWN || columnNumber == UNKNOWN || hyperlinkStartInd == -1) {
+    if (path == null || lineNumber == UNKNOWN || hyperlinkStartInd == -1) {
       return Collections.emptyList();
     }
-    if (!format.isZeroBasedLine()) {
+    if (!format.isZeroBasedLineNumbering()) {
       lineNumber--;
     }
-    if (!format.isZeroBasedColumn()) {
+    if (!format.isZeroBasedColumnNumbering()) {
       columnNumber--;
     }
+    lineNumber = Math.max(lineNumber, -1);
+    columnNumber = Math.max(columnNumber, -1);
     FileHyperlinkRawData data = new FileHyperlinkRawData(path, lineNumber, columnNumber,
                                                          hyperlinkStartInd, hyperlinkEndInd);
     return Collections.singletonList(data);
index 63713fb8c7bc38d09d933cf059cdb045b0a7c254..87c5268dbed93457d6287606e33a5d1bbf9908ec 100644 (file)
@@ -21,17 +21,17 @@ import java.util.regex.Pattern;
 
 public class PatternHyperlinkFormat {
   private final Pattern myPattern;
-  private final boolean myZeroBasedLine;
-  private final boolean myZeroBasedColumn;
+  private final boolean myZeroBasedLineNumbering;
+  private final boolean myZeroBasedColumnNumbering;
   private final PatternHyperlinkPart[] myLinkParts;
 
   public PatternHyperlinkFormat(@NotNull Pattern pattern,
-                                boolean zeroBasedLine,
-                                boolean zeroBasedColumn,
+                                boolean zeroBasedLineNumbering,
+                                boolean zeroBasedColumnNumbering,
                                 @NotNull PatternHyperlinkPart... linkParts) {
     myPattern = pattern;
-    myZeroBasedLine = zeroBasedLine;
-    myZeroBasedColumn = zeroBasedColumn;
+    myZeroBasedLineNumbering = zeroBasedLineNumbering;
+    myZeroBasedColumnNumbering = zeroBasedColumnNumbering;
     myLinkParts = linkParts;
   }
 
@@ -40,12 +40,12 @@ public class PatternHyperlinkFormat {
     return myPattern;
   }
 
-  public boolean isZeroBasedLine() {
-    return myZeroBasedLine;
+  public boolean isZeroBasedLineNumbering() {
+    return myZeroBasedLineNumbering;
   }
 
-  public boolean isZeroBasedColumn() {
-    return myZeroBasedColumn;
+  public boolean isZeroBasedColumnNumbering() {
+    return myZeroBasedColumnNumbering;
   }
 
   @NotNull