#148 ErrorList overview doesn't work with symlinks

closed-accepted
Alan Ezust
None
5
2012-11-28
2012-10-01
Patrick Eibl
No

This affects the currently released and trunk versions of ErrorList. To reproduce, with Console/ErrorList installed on linux:
Make sure underline errors option is checked for ErrorList (makes bug more obvious)
Create a file with some text, and a symlink (can be done from jEdit console):
echo hello > ~/myFile
ln -s ~/myFile ~/mySymlink

Trigger an ErrorList error on mySymlink:
echo ~/mySymlink:1:errorMessage

The error appears in ErrorList, but there is no overview or underline if mySymlink is opened as a buffer.

This happens because symlinks are resolved on the buffer path, but not on the ErrorList path, so there will be a mismatch if they are both the same symlink. A solution is this patch, which does resolve symlinks on ErrorList paths. A side effect is that the ErrorList will not show the symlink path that appeared in the original error (it will show the resolved path instead). If there was a desire to fix that as well, then the errors hash would have to be accessed exclusively with symlink-resolved paths, while maintaining the original symlink path as part of the DefaultError state.

Index: errorlist/DefaultErrorSource.java

--- errorlist/DefaultErrorSource.java (revision 22222)
+++ errorlist/DefaultErrorSource.java (working copy)
@@ -410,7 +410,7 @@
*/
public void setFilePath(String newPath)
{
- path = newPath;
+ path = MiscUtilities.resolveSymlinks(newPath);
name = MiscUtilities.getFileName(path);
}// }}}

Discussion

  • Alan Ezust
    Alan Ezust
    2012-11-28

    Committed 22506.

     
  • Alan Ezust
    Alan Ezust
    2012-11-28

    • assigned_to: nobody --> ezust
    • status: open --> closed-accepted