diff --git a/pom.xml b/pom.xml
index f58cb8f..f5aa778 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
de.markiewb.netbeans.plugins
open-file-at-cursor-plugin
- 1.1.2
+ 1.2.0
nbm
diff --git a/src/main/java/de/markiewb/netbeans/plugins/resourcehyperlink/ResourceHyperlinkProvider.java b/src/main/java/de/markiewb/netbeans/plugins/resourcehyperlink/ResourceHyperlinkProvider.java
index 0fcd322..5159384 100644
--- a/src/main/java/de/markiewb/netbeans/plugins/resourcehyperlink/ResourceHyperlinkProvider.java
+++ b/src/main/java/de/markiewb/netbeans/plugins/resourcehyperlink/ResourceHyperlinkProvider.java
@@ -176,7 +176,21 @@ private Set findFiles(Document doc, String path) {
FileObject docFO = NbEditorUtilities.getFileObject(doc);
result.addAll(getMatchingFilesFromSourceRoots(FileOwnerQuery.getOwner(docFO), path));
- //d) fallback to support absolute paths - exact match
+ //d) fallback to exact matches in project root
+ FileObject docFOX = NbEditorUtilities.getFileObject(doc);
+ Project owner = FileOwnerQuery.getOwner(docFOX);
+ if (null != owner) {
+ FileObject projectDirectory = owner.getProjectDirectory();
+ if (null != projectDirectory) {
+ //exact matches
+ FileObject fileObject = projectDirectory.getFileObject(path);
+ if (fileObject != null && !fileObject.isFolder()) {
+ result.add(fileObject);
+ }
+ }
+ }
+
+ //e) fallback to support absolute paths - exact match
if (new File(path).exists() && !FileUtil.toFileObject(FileUtil.normalizeFile(new File(path))).isFolder()) {
FileObject absolutePath = FileUtil.toFileObject(FileUtil.normalizeFile(new File(path)));
result.add(absolutePath);
diff --git a/src/test/java/NewMain.java b/src/test/java/NewMain.java
index a6c9621..dff8a6c 100644
--- a/src/test/java/NewMain.java
+++ b/src/test/java/NewMain.java
@@ -7,6 +7,8 @@ public static void main(String[] args) {
+ "com/toy/anagrams/lib/WordLibrary.java");
System.out.println("filename = " + "WordLibrary.java");
System.out.println("Hyper");
+ System.out.println("./src\\test\\java\\foo\\NewMain.java");
+ System.out.println(".\\src\\test\\java\\foo\\NewMain.java");
System.out.println("de.markiewb.netbeans.plugins.resourcehyperlink.ResourceHyperlinkProvider");
System.out.println("de.markiewb.netbeans.plugins.resourcehyperlink.ResourceHyperlinkProvider");
System.out.println("D:\\ws\\nb-resource-hyperlink-at-cursor\\doc\\screenshot-1.0.0.png");