Quelklef / fitch

Interactive proof assistant for Fitch-style natural deduction
https://maynards.site/fitch
3 stars 0 forks source link

Better implementation for prettifying user input #17

Open Quelklef opened 2 years ago

Quelklef commented 2 years ago

As people type in the proof <input>s, their text gets prettified to unicode.

The way this happens is ugly. We run the input through Formula.desugar, which does the prettification, and then send a SetFormulaAt update message. As part of the interpretation of this message, we use a helper function reup to find the <input> by its ID and change its value to the prettified text, without moving the caret.

We can't just rely on value :: Text -> Attribute because that would fuck up the caret.

However, Mason has pointed out that on "input" is effectual, so we can perform this entire reup business within an input handler!