Commits

ZyX_I  committed f17bd39

@%aurum/repo: Normalize file path, this fixes issue with wrong status in new
powerline status segment (new powerline tries to get file path
before my autocmd initiates directory change thus making getrrf
fail due to)

  • Participants
  • Parent commits 7dbd54c

Comments (0)

Files changed (2)

File autoload/aurum/repo.vim

 endfunction
 "▶1 reltorepo :: repo, path → rpath
 function s:deffuncs.reltorepo(repo, path)
-    return join(s:_r.os.path.split(s:_r.os.path.relpath(a:path,
-                \                                       a:repo.path))[1:], '/')
+    " Symlinks are managed by mercurial as regular files with special attribute 
+    " containing linked path, thus no need to resolve symlinks if they are at 
+    " the last component. But file under directory symlinks are not managed 
+    " (because directory symlink is managed as a regular file) thus to normalize 
+    " path you need to resolve directory, but not resolve file
+    " Same for git.
+    return join(s:_r.os.path.split(s:_r.os.path.relpath(
+                \s:_r.os.path.join(
+                \   s:_r.os.path.realpath(s:_r.os.path.dirname(a:path)),
+                \   s:_r.os.path.basename(a:path)),
+                \a:repo.path))[1:], '/')
 endfunction
 "▶1 checkremote
 function s:deffuncs.checkremote(...)

File python/aurum/powerline.py

         else:
             funcs = guess()
             bdict['funcs'] = funcs
+    else:
+        bdict['funcs'] = funcs
 
     if not funcs:
         return None