aboutsummaryrefslogtreecommitdiff
path: root/lib/Daffm/Action/Core.hs
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-10-05 20:21:13 +0530
committerAkshay Nair <phenax5@gmail.com>2025-10-08 13:05:32 +0530
commit8cc1763237f9f12d25cf00735ce63c5655877899 (patch)
tree2ac9e6cd021327b6eb30ab7305e24aec68df3ab3 /lib/Daffm/Action/Core.hs
parent0979d4e678514a8e0cdcbe1fbb174667c5361c8a (diff)
downloaddaffm-8cc1763237f9f12d25cf00735ce63c5655877899.tar.gz
daffm-8cc1763237f9f12d25cf00735ce63c5655877899.zip
Add CmdChain to run commands sequentially in keys
Diffstat (limited to 'lib/Daffm/Action/Core.hs')
-rw-r--r--lib/Daffm/Action/Core.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Daffm/Action/Core.hs b/lib/Daffm/Action/Core.hs
index f80e41a..a8dad32 100644
--- a/lib/Daffm/Action/Core.hs
+++ b/lib/Daffm/Action/Core.hs
@@ -65,8 +65,8 @@ cmdSubstitutions cmd = do
let selections = Set.elems stateFileSelections
let selectionsOrCurrent = if Set.null stateFileSelections then [file] else selections
let subst =
- Text.replace "%" file
- . Text.replace "%d" stateCwd
+ Text.replace "%" (escape file)
+ . Text.replace "%d" (escape stateCwd)
. Text.replace "%s" (Text.unwords $ map escape selections)
. Text.replace "%S" (Text.dropWhileEnd (== '\n') $ Text.unlines selections)
. Text.replace "%f" (Text.unwords $ map escape selectionsOrCurrent)