mogenslund/liquid

Why using refs for editor?

ertugrulcetin opened this issue · 2 comments

Hi @mogenslund,

I'm reading your source code what is the reason that you use ref for editor? Why not atom or any other mutable reference type?

Thanks..

Hi @ertugrulcetin

That is a good question. I reasoned it would be the best choice, since I have different threads that might access the editor ref around the same time. Multiple scripts might be producing output into different buffers. Rendering windows are also done in parallel and the functionality that listenes for key presses.
I actually refactured from atom to ref at some point because the output in same cases, with fast changes, produced inconsistent output to the window.
Maybe I could have solved that in another way.

Best regards,
Mogens

Thank you for the clarification, good project!