yi-editor / yi

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

"Not in update transaction" error #1095

Open noughtmare opened 5 years ago

noughtmare commented 5 years ago

To reproduce:

  1. Run a :yi command, for example :yi atBoundaryB.
  2. Input something when prompted (note that you have to go into insert mode).
  3. At the last prompt stay in insert mode right before submitting.
  4. After submitting press ESC to deactivate insert mode, this will cause the error "Not in update transaction".

Alternatively:

  1. Run :e some-directory-name.
  2. Move your cursor to a line that lists a file that is in that directory.
  3. Activate insert mode with i.
  4. Press ENTER to open the file.
  5. Deactivate insert mode with ESC, this will cause the error "Not in update transaction".

This has to do with the fact that the insert mode is activated in a different buffer than where it was deactivated.

To fix this the keymap state can be reset when switching buffers, or the update transaction can be ended when leaving a buffer and restarted when entering a buffer in insert mode.