yi-editor / yi

The Haskell-Scriptable Editor
GNU General Public License v2.0
1.5k stars 199 forks source link

Units of work on Emacs Keymap are too granular #1086

Open RubenAstudillo opened 6 years ago

RubenAstudillo commented 6 years ago

When launching with the Emacs keymap, every single key that is inserted on the buffer is added as an Insert event on the undo/redo list. To check this launch yi, write "hello world and foo bar" and the press C-x u a few times, it will be clear what I am meaning.

As a consequence of how the Keymap is implemented, via the Alternative instance of KeymapM () it is not clear where we should startUpdateTranssaction to re-use the machinery already at work on the undo/redo system with the vim keymap. The algorithm of how Emacs determines an unit of work is given here.