improve display of relative path to file
authorJoey Hess <joeyh@joeyh.name>
Wed, 12 Apr 2023 19:11:44 +0000 (15:11 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 12 Apr 2023 19:11:44 +0000 (15:11 -0400)
When in a subdirectory, and the file is too, it used to display eg
../subdir/thefile and now will display thefile.

Command/WhereUsed.hs

index a213ff8aae1d37f571bddf6e0d2da9cb8bdb4c47..2ab4b568f7180592dfeb1485b965fbad2cb185bc 100644 (file)
@@ -57,7 +57,8 @@ seek o = withKeyOptions (Just (keyOptions o)) False dummyfileseeker
 
 start :: WhereUsedOptions -> (SeekInput, Key, ActionItem) -> CommandStart
 start o (_, key, _) = startingCustomOutput key $ do
-       fs <- filterM stillassociated 
+       fs <- filterM stillassociated
+               =<< mapM (liftIO . relPathCwdToFile)
                =<< mapM (fromRepo . fromTopFilePath)
                =<< getAssociatedFiles key
        forM_ fs $ display key . QuotedPath