purebred-mua / purebred

A terminal based mail user agent based on notmuch
GNU Affero General Public License v3.0
139 stars 19 forks source link

refactor StatefulEditor #446

Closed frasertweedale closed 2 years ago

frasertweedale commented 2 years ago

Refactor the StatefulEditor type and related functions. Save the whole Editor when creating a snapshot, which simplifies the implementation. Hide the constructor and the _editState field accessor to prevent access to the saved editor state. Add the statefulEditor smart constructor which sets both the initial value and the initial snapshot (to the same value).

romanofski commented 2 years ago

Nice!