Closed ChrisPenner closed 7 years ago
Does this impact performance negatively ? btw, I did work around that out-of-sync buffer by using the seq function (from base) If the updated buffer is not needed in dispatch, maybe this problem is not critical at all ?
These issues should be fixed now that we've switched to free-monads; let me know if problems persist.
liftAction
is implemented and allows runningAction
insideBufAction
; but leaves some things to be desired. Currently the idea is that a Buffer is focused alongside the current editor state; any BufActions that affect the buffer affect the 'COPY' of the buffer that's held alongside the editor state without actually effecting the buffer contained inside the Editor state. After executing theBufAction
the Buffer in the Editor state is replaced with the copy. This allows things to get out of sync in situations where events are dispatched inside aBufAction
usingliftAction
.The plan to fix this is to change all lenses which access a buffer through the
HasBuffer
constraint into Lens Traversals; and then to rely on theExceptT
result from traversals to handle errors if a BufAction deletes the buffer it's operating on, or if something goes funny inside a dispatched action.Should hopefully work out nicely; but I'm new to ExceptT so we'll see how it goes.