Malabarba / aggressive-indent-mode

Emacs minor mode that keeps your code always indented. More reliable than electric-indent-mode.
850 stars 36 forks source link

Cursor's position jumps unexpectedly #113

Open carlcotner opened 6 years ago

carlcotner commented 6 years ago

In certain situations, the cursor jumps unexpectedly. A simple example follows:

(and (this)
   | (that)|)

The two vertical bars represent a selected region. When the region is deleted, the cursor jumps to the beginning of the line:

(and (this)
|    )

instead of just before the closing parenthesis:

(and (this)
    |)

The corresponding behavior is correct when there are no extra spaces selected around the parentheses before the deletion:

(and (this)
    |(that)|)