Evil does its best to ensure that the point can neven be at the end of the line *in normal state*. However, other elisp commands can still move the point wherever they like, so if you wrap both of those commands in a function foo, calling foo will exhibit the typical emacs behavior since evil can't get a word in edgewise (the last symbol is not carried to the next line). Notice that if you run those commands one after another with M-:, evil restores its invariant in between, and you DO get the next last symbol carried to the next line.
On 6/2/14, Dima Gorbik <[email protected]> wrote: > Hello all, > > Please take a look at the following piece of code: > > (goto-char (point-max)) > (insert "\n") > > In normal state of evil-mode goto-char moves the cursor to the end of line > visually, but it points before the last symbol, not after. Although the > example above works just fine -- it works as if the cursor is pointing after > the last symbol so the last symbol is not carried to the next line which is > a correct behavior. I wonder how evil determines that it needs to insert > after the last symbol, not before. > > The reason I ask about this is because I am trying to understand why hitting > enter in haskell-mode repl in normal state in evil-mode puts the last symbol > of the current line on the next line. It looks like (insert "\n") is invoked > in a callback and evil doesn't know that it needs to maintain the > compatibility. > > Thanks, > Dima > _______________________________________________ > implementations-list mailing list > [email protected] > https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list > _______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
