From 1481e69cee500a98aafca08e676c9e47fb1c9fb7 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Thu, 30 Oct 2025 09:25:59 +0530 Subject: Allow multilevel extend in config --- lib/Daffm/Configuration.hs | 6 ++---- notes.org | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/Daffm/Configuration.hs b/lib/Daffm/Configuration.hs index 884db36..3b61d6e 100644 --- a/lib/Daffm/Configuration.hs +++ b/lib/Daffm/Configuration.hs @@ -80,10 +80,8 @@ loadConfigFile pathM = do config <- load cfgPath case configExtend config of Just path -> do - baseCfgPath <- resolveConfigPath $ Just $ Text.unpack path - if baseCfgPath == cfgPath - then pure config - else (config <>) <$> load baseCfgPath + baseCfg <- loadConfigFile $ Just (Text.unpack path) + pure $ config <> baseCfg _ -> pure config where load = (>>= parseWithDefault) . IO.try . Text.readFile diff --git a/notes.org b/notes.org index 2c6c865..935a116 100644 --- a/notes.org +++ b/notes.org @@ -1,7 +1,8 @@ - [X] commands: move cursor: move +1, move -1, move 5, move $, move 0 - [X] rename command-shell to evaluate -- [ ] Allow recursive config extends (@A -> @B -> @C) +- [X] Allow recursive config extends (@A -> @B -> @C) - [ ] allow escaping % in commands +- [ ] fix problems with substitutions (maybe switch to env vars?) - [ ] custom commands - [ ] cmdline autocompletion - [ ] handle permissions errors -- cgit v1.3.1