Issue #171 resolved

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

Anonymous avatarAnonymous created an issue

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

Comments (7)

  1. Frank Fischer
    • 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

    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

    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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.