Skip to content

Commit

Permalink
fix: removes strikethrough-style task completion support
Browse files Browse the repository at this point in the history
  • Loading branch information
smallhadroncollider committed Aug 22, 2019
1 parent 4bbb04d commit 1d9fe57
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
3 changes: 1 addition & 2 deletions roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
- Break up State module
- Parse checkItems Trello JSON using Aeson FromJSON rather than needing extra record type
- Remove duplication of config - currently using ini and hard-coded defaults
- Remove `~` style sub-task complete parsing
@ 2018-12-10
- Use Shake instead of bash script

## Bugs
Expand Down Expand Up @@ -306,3 +304,4 @@
* [x] Shows full Mode print out
- Add a "complete" action
> Moves to last column and removes date. Space bar by default.
- Remove `~` style sub-task complete parsing
6 changes: 1 addition & 5 deletions src/IO/Markdown/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ClassyPrelude
import Control.Lens ((^.))

import Data.Sequence (adjust')
import Data.Text as T (dropAround, splitOn, strip)
import Data.Text as T (splitOn, strip)
import Data.Text.Encoding (decodeUtf8With)

import Data.Taskell.Date (dayToOutput)
Expand All @@ -23,17 +23,13 @@ import IO.Config.Markdown (Config, descriptionOutput, dueOutput, subta
taskOutput, titleOutput)

-- parse code
trimTilde :: Text -> Text
trimTilde = strip . T.dropAround (== '~')

addSubItem :: Text -> Lists -> Lists
addSubItem t ls = adjust' updateList i ls
where
i = length ls - 1
st
| "[ ] " `isPrefixOf` t = ST.new (drop 4 t) False
| "[x] " `isPrefixOf` t = ST.new (drop 4 t) True
| "~" `isPrefixOf` t = ST.new (trimTilde t) True
| otherwise = ST.new t False
updateList l = updateFn j (T.addSubtask st) l
where
Expand Down
8 changes: 1 addition & 7 deletions test/IO/MarkdownTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ test_markdown =
(assertEqual
"List item with Sub-Task"
(makeSubTask "Blah" True, [])
(start defaultConfig (listWithItem, []) (" * ~Blah~", 1)))
(start defaultConfig (listWithItem, []) (" * [x] Blah", 1)))
, ignoreTest $
testCase
"List item without list"
Expand Down Expand Up @@ -194,12 +194,6 @@ test_markdown =
"List item with Sub-Task"
(makeSubTask "Blah" False, [])
(start alternativeConfig (listWithItem, []) ("- Blah", 1)))
, testCase
"Complete Sub-Task (old style)"
(assertEqual
"List item with Sub-Task"
(makeSubTask "Blah" True, [])
(start alternativeConfig (listWithItem, []) ("- ~Blah~", 1)))
]
]
, testGroup
Expand Down

0 comments on commit 1d9fe57

Please sign in to comment.