aboutsummaryrefslogtreecommitdiff
path: root/lib/Daffm/Action/Core.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Daffm/Action/Core.hs')
-rw-r--r--lib/Daffm/Action/Core.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Daffm/Action/Core.hs b/lib/Daffm/Action/Core.hs
index 337801e..ce04073 100644
--- a/lib/Daffm/Action/Core.hs
+++ b/lib/Daffm/Action/Core.hs
@@ -32,10 +32,13 @@ goBackToParentDir = do
dir <- gets stateParentDir
loadDir dir (Text.pack . takeDirectory $ Text.unpack dir)
+changeDir :: FilePathText -> AppEvent ()
+changeDir dir = do
+ loadDir dir (Text.pack $ takeDirectory $ Text.unpack dir)
+
goHome :: AppEvent ()
goHome = do
- dir <- liftIO getHomeDirectory
- loadDir (Text.pack dir) (Text.pack $ takeDirectory dir)
+ liftIO getHomeDirectory >>= changeDir . Text.pack
openSelectedFile :: AppEvent ()
openSelectedFile = do