ChrisPenner / rasa

Extremely modular text editor built in Haskell
GNU General Public License v3.0
616 stars 42 forks source link

Allow running `Action`s inside `BufAction` via `liftAction` #25

Closed ChrisPenner closed 7 years ago

ChrisPenner commented 7 years ago

Do some clever lens polymorphism to allow Actions to work in the context of a BufAction.

Note that there's one place where this could go wrong; the state of the focused buffer is kept alongside the Editor state as WELL as in the buffers map; if it's edited within the buffers map somehow (only way right now is to embed a BufAction inside an Action inside a BufAction; which is unlikely but possible) then behaviour is undefined and likely some changes would be lost. It should be fixable later; but this'll do fine for now!

ChrisPenner commented 7 years ago

@clojj ; this should allow you to embed Actions inside a BufAction using liftAction; let me know if it works for you; I'll be merging this through after I clean up some documentation.