eraserhd / parinfer-rust

A Rust port of parinfer.
ISC License
546 stars 42 forks source link

Fast typing causes hanging indents to become misaligned in vim #123

Open sheluchin opened 2 years ago

sheluchin commented 2 years ago

Given a form like:

(def foo [1
          2])

Typing quickly at the top level causes the the alignment to break:

(def foobar [1]
       2)

This happens under smart and indent parinfer_mode, but not when using paren mode.

The timing of the misalignment seems inconsistent, and things work correctly most of the time. To reproduce it consistently, instead of replacing foo with foobar (a small number of keystrokes), just button mash in insert mode.

Pasting and substitution can also produce the same result.

daveyarwood commented 2 years ago

I've noticed a similar issue where if I use visual insert mode to move a block of code over to the right, and I type in the space characters too quickly, then all hell breaks loose. It works correctly if I slowly enter the space characters one by one.