atom/vim-mode — pull request #407 by tristil (2014-09-28 06:48:51+00:00)
Title: Don't clear " register 'o' or 'O' on empty line

I opened a PR for this earlier but I didn't properly understand what was going on, so I closed it. Now I'm clear on what the issue is and exactly how to reproduce. It makes sense for example, that it especially bothered me, because I mostly used Atom to edit Markdown documents.

An 'o' or 'O' that placed the cursor at the start of a line would cause the
registerChangeHandler method in VimState to receive a change of newText '',
oldText ''. The old text of '' would be put in the " register, wiping out
anything that had been yanked previously.

In other words, if you opened up a line and the new cursor position was
indented, then the " register was preserved. But if you moved to the start of
an empty line and opened up the next line such that the cursor was now on the
first position of the line, then the " register would be wiped out. This is
more noticeable when editing an unindented document than when editing code.

In any case, there doesn't seem to be a legitimate case for storing a change
that doesn't change the buffer.