aboutsummaryrefslogtreecommitdiff
path: root/lib/Daffm/Action/Core.hs
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-11-10 23:28:05 +0530
committerAkshay Nair <phenax5@gmail.com>2025-11-10 23:28:05 +0530
commit0c3b673e1614677a20f0b0b22af8bd017228b5e0 (patch)
tree95200787fc13997d0b50e9d9e20d8d8beb2537df /lib/Daffm/Action/Core.hs
parenta16933476187a349d619ab29f73dbcae81c8cb24 (diff)
downloaddaffm-0c3b673e1614677a20f0b0b22af8bd017228b5e0.tar.gz
daffm-0c3b673e1614677a20f0b0b22af8bd017228b5e0.zip
Add basic selection-add/remove commands
Diffstat (limited to 'lib/Daffm/Action/Core.hs')
-rw-r--r--lib/Daffm/Action/Core.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Daffm/Action/Core.hs b/lib/Daffm/Action/Core.hs
index 85f861a..ba50638 100644
--- a/lib/Daffm/Action/Core.hs
+++ b/lib/Daffm/Action/Core.hs
@@ -99,6 +99,14 @@ toggleCurrentFileSelection = do
Nothing -> pure ()
moveCurrent 1
+addFileSelection :: FilePathText -> AppEvent ()
+addFileSelection path = do
+ modify $ \st -> st {stateFileSelections = Set.insert path . stateFileSelections $ st}
+
+removeFileSelection :: FilePathText -> AppEvent ()
+removeFileSelection path = do
+ modify $ \st -> st {stateFileSelections = Set.delete path . stateFileSelections $ st}
+
clearFileSelections :: AppEvent ()
clearFileSelections =
modify $ \st -> st {stateFileSelections = Set.empty}