Issue #3 resolved

`evil-move-cursor-back' var not working

Michael Markert
created an issue

I set `evil-move-cursor-back' to nil, but It is moved back nonetheless when exiting insert-state.

Comments (7)

  1. Vegard Øye
    • changed status to open

    Commit c312613 fixes the end-of-line behavior of the cursor when evil-move-cursor-back is nil.

    I guess that if you want this behavior, then you probably also want to be able to cross newlines. Am I right? If so, I can add a customization variable for that too. :)

  2. Michael Markert reporter

    Care to elaborate on that? How would that affect the movement behavior?

    And sorry I was unaware that my tests were completely biased and it only occurred at the end of line. But the cursor jumping drove me crazy (I use `jk` to exit).

  3. Michael Markert reporter

    After playing with the change: It was way better before. The problem is that the point is not valid for operations like `x`, `r` and `s` (maybe even more).

  4. Vegard Øye

    Yeah, there is a number of edge cases that need to be sorted out. All of the problems you mention can be fixed in one fell swoop by modifying the behavior of evil-forward-char, though.

    I'll look into it.

  5. Vegard Øye

    I have added some adjustments in commit 2a9b01f: x, s et al. may now delete the newline when the cursor is at the very end of the line. There is also the customization variable evil-cross-lines, which when t allows h, l, f and other motions to move beyond the current line.

    You'll probably want one of these combinations:

    • evil-move-cursor-back is t and evil-cross-lines is nil (the default)
    • evil-move-cursor-back is nil and evil-cross-lines is t

    The latter is the most Emacs-like. There may be more edge cases to sort out: the tricky bit is to define exactly what the most logical and coherent behavior is ...

    Also, keep in mind that vi's cursor-jumping provides a valuable visual cue when editing in the terminal. I'm guessing that's where it comes from.

  6. Michael Markert reporter

    Ah now I understand what you meant with crossing newlines, I didn't know that emacs allowed it, but well point is after all just an int ;) I'll try the latter combination and keep you informed, great it's customizable.

    Sure it's a valuable cue but I prefer colors (AFAIR (g)vim couldn't offer that). Nevertheless the rationale is perfectly understandable, but not that practical with emacs -- I really had a hard time with this and eval-last-sexp, most of the time I just went into insert-state.

  7. Log in to comment