Issue #171 resolved

evil-insert-line doesn't work properly when line begins with whitespace characters.

Anonymous created an issue

Hitting "I" at: " ap[a]" should take you to " [a]pa" not: "[ ] apa".

Comments (7)

  1. Frank Fischer repo owner
    • changed status to open

    And this is exactly what happens, at least here. Please give a full example starting from make emacs in evil's source and which versions of Emacs and evil you use (git hash).

    The only case that I can image you mean is the follow. If the line starts with a TAB character and you type I ESC, then the following should happen. After typing I point should be placed on the first non-blank character of the line. After ESC point is moved back one character which is the TAB. Visually point is moved back to the beginning of the line.

    If this is the case you mean then there is nothing (simple) that we can do because this is a property of Emacs. When point is on a TAB character then Vim shows the cursor visually on the last column occupied by the TAB, Emacs shows the cursor on the first. But this is only a visual difference.

    Please let us know if this is the situation you mean. Otherwise please provide more specific information (configuration options, versions, starting with make emacs) that allows to reproduce the error.

  2. Anonymous

    The problem seems to be that when evil-auto-indent is nil back-to-indentation isn't called.

  3. Frank Fischer repo owner

    Hm, what exactly is the difference to calling (back-to-indentation) directly without calling (evil-move-beginning-of-line) first? I think this makes no difference, thus it is the same as if evil-auto-indent is set to t.

    I suppose that evil-auto-indent should have no influence on evil-insert-line, right? (what does Vim do?) In this case it would be better to remove that conditional code completely and replace it by a single call to back-to-indentation, I think.

  4. Frank Fischer repo owner

    Make evil-insert-line always start insertion at first non-blank.

    evil-insert-line, usually bound to "I", should always move point to the first non-blank character of the line (according to vim). This should be independent from evil-auto-indent. That option should only influence the (automatic) indentation of evil-open-above and evil-open-below.

    This change makes evil-insert-line call back-to-indentation unconditionally.

    This fixes #171.

    → <<cset 87b9272ca604>>

  5. Log in to comment