Editor doesn't allow cursor between indent levels


#1

For example, if you type:

def length
  if @populated
    @items.length
  else
    0
  end
end

then it’s impossible to put the cursor here:

   @items.length
  ^

Ie., between “tab stops”.

While auto-indenting like this is fine in theory, it makes cursor navigation non-deterministic. It means that if my cursor is at the “l” in “else”:

  else
   ^
    0
  end

…and I hit down-arrow, I end up not below the “l”, but one character to the right:

  else
    0
    ^
  end

That sort of thing breaks editing when you’re working fast. Let’s say you wanted to comment out all the lines. (There is surely a “comment out selection” command, but that’s beside the point.) You put your cursor here:

def length
^

In Sublime, you might hit “#”, arrow-down, arrow-left, “#”, arrow-down, arrow-left, etc. That doesn’t work in Atom, as arrow-left would put you on the wrong line. So in Atom you might hit “#”, arrow-down, “#”, arrow-down, etc., but then you end up with this beauty:

#def length
#  if @populated
#    @items.length
#  else
#    0
#  end
e#nd

I don’t see a way for the API to let a package to modify this behaviour cleanly.