This repository has been archived by the owner on Mar 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
294 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# EditorConfig - http://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
trim_trailing_whitespace = true | ||
insert_final_newline = false | ||
indent_style = space | ||
indent_size = 4 | ||
charset = utf-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module Flow.Actions.Edit (event) where | ||
|
||
import Graphics.Vty.Input.Events (Event) | ||
import Flow.State (Stateful, Mode(..), EditMode(..), mode) | ||
|
||
import qualified Flow.Actions.Edit.CreateTask as CreateTask | ||
import qualified Flow.Actions.Edit.EditTask as EditTask | ||
import qualified Flow.Actions.Edit.CreateList as CreateList | ||
import qualified Flow.Actions.Edit.EditList as EditList | ||
|
||
event :: Event -> Stateful | ||
|
||
-- for other events pass through to relevant modules | ||
event e s = case mode s of | ||
Edit CreateTask -> CreateTask.event e s | ||
Edit EditTask -> EditTask.event e s | ||
Edit EditList -> EditList.event e s | ||
Edit (CreateList _) -> CreateList.event e s | ||
_ -> return s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Flow.Actions.Edit.CreateList (event) where | ||
|
||
import Graphics.Vty.Input.Events | ||
import Flow.State (Stateful, write, createListFinish, normalMode, createListBS, createListChar) | ||
|
||
event :: Event -> Stateful | ||
event (EvKey KEnter _) = (write =<<) . createListFinish | ||
event (EvKey KEsc _) = normalMode | ||
event (EvKey KBS _) = createListBS | ||
event (EvKey (KChar char) _) = createListChar char | ||
event _ = return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Flow.Actions.Edit.CreateTask (event) where | ||
|
||
import Graphics.Vty.Input.Events | ||
import Flow.State (Stateful, write, below, store, normalMode, insertBS, insertCurrent) | ||
|
||
event :: Event -> Stateful | ||
event (EvKey KEnter _) = (write =<<) . (below =<<) . store | ||
event (EvKey KEsc _) = (write =<<) . normalMode | ||
event (EvKey KBS _) = insertBS | ||
event (EvKey (KChar char) _) = insertCurrent char | ||
event _ = return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Flow.Actions.Edit.EditList (event) where | ||
|
||
import Graphics.Vty.Input.Events | ||
import Flow.State (Stateful, write, normalMode, editListBS, editListChar) | ||
|
||
event :: Event -> Stateful | ||
event (EvKey KEnter _) = (write =<<) . normalMode | ||
event (EvKey KEsc _) = (write =<<) . normalMode | ||
event (EvKey KBS _) = editListBS | ||
event (EvKey (KChar char) _) = editListChar char | ||
event _ = return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Flow.Actions.Edit.EditTask (event) where | ||
|
||
import Graphics.Vty.Input.Events | ||
import Flow.State (Stateful, write, normalMode, insertBS, insertCurrent) | ||
|
||
event :: Event -> Stateful | ||
event (EvKey KEnter _) = (write =<<) . normalMode | ||
event (EvKey KEsc _) = (write =<<) . normalMode | ||
event (EvKey KBS _) = insertBS | ||
event (EvKey (KChar char) _) = insertCurrent char | ||
event _ = return |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.