Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<enter> in insert mode yields a newline with no indent #45

Closed
TheBB opened this issue Dec 4, 2011 · 3 comments
Closed

<enter> in insert mode yields a newline with no indent #45

TheBB opened this issue Dec 4, 2011 · 3 comments

Comments

@TheBB
Copy link
Member

TheBB commented Dec 4, 2011

Originally reported by: topher200 (Bitbucket: topher200, GitHub: topher200)


=== Expected behavior ===
User enters insert mode and starts typing a function. should yield a new line, with the cursor at the correct auto-indent location.

=== Actual behavior ===
User enters insert mode and starts typing a function. yields a new line, with the cursor all the way to the left column.

=== Observations ===
Exiting insert mode and auto-indenting the code ("==") fixes the problem, which shows that evil knows how to indent the code - it's just not doing it.

Emac's describe-key shows that the function being called for in insert mode is "newline". I would expect it to call "evil-ret". "evil-ret" is called on in normal mode, and its documentation talks about it handling insert-mode.

"customize-group" shows that the "auto indent" variable is set to default. That seems to be working fine- creating a new line by entering insert-mode (with "o" or "O") yields a newline with the cursor in the correct spot.

=== Steps to reproduce ===
Write the first line to a function with nested indentation. Example:

(if (not

and press . Notice that the cursor is on the newline on the far left, as shown here by the "|":

(if (not
|

I would expect the cursor to be here:

(if (not
     |

@TheBB
Copy link
Member Author

TheBB commented Dec 4, 2011

Original comment by topher200 (Bitbucket: topher200, GitHub: topher200):


This seems like a strange bug to exist; it's easily fixable, and pretty obvious behavior. That leads me to believe that it's being caused by some strangeness on my machine, but if it is I can't track it down.

@TheBB
Copy link
Member Author

TheBB commented Dec 4, 2011

Original comment by topher200 (Bitbucket: topher200, GitHub: topher200):


I created a patch for this bug, and initiated a merge request here: https://gitorious.org/evil/evil/merge_requests/23.

@TheBB
Copy link
Member Author

TheBB commented Dec 4, 2011

Original comment by Michael Markert (Bitbucket: cofi, GitHub: cofi):


The binding has been removed on purpose:

commit 6b1e5ab78123e64e50a2401bc5fee11486854d40
Author: Vegard Øye <vegard_oye@hotmail.com>
Date:   Thu Oct 6 15:11:36 2011 +0200

    Remove Insert state binding for "RET"
    
    Unbind `evil-ret' in Insert state. Many modes bind "RET" to a custom
    command, so it is best to leave this key alone in Insert state.

@TheBB TheBB closed this as completed Jan 19, 2017
shadowrylander pushed a commit to syvlorg/aiern that referenced this issue Jun 28, 2021
Addresses emacs-evil#45. Tests still need to be added, but this at least fixes the
major issues for me.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant