The fix to ignore invisibles () introduces a new bug when pasting lines
from the clipboard (see screencast below).
As the commit takes the content of `@buffer.lineFromRow(bufferRow)` to
test against the `decreaseIndentRegex`, it will actually test the
content of the row the cursor is on instead of the content that is
being pasted. And this (of course) could cause unexpected indentations.
Currently there are only two regexps that can influence the indents.
Those are `increaseIndentPattern` (which tells Atom the indent of next
line should be increased) and `decreaseIndentPattern` (which tells Atom
the indent of the current line should be decreased).
But I found that a couple of languages would need a 3rd regexp in order
to support their use cases. This 3rd regexp should be a mixture of the
existing two so it tells Atom that the indent of the next line should
decrease.
I’ll add a screencast to show a use case for this 3rd regexp which I
would like to call `decreaseNextIndentPattern`.
Previously, we allowed a mix of tabs and spaces to be counted toward the
indentation of a line. This caused problems when auto-indenting lines in
a hard-tabbed file that contained “alignment spaces”, such as occurs in
aligned comment blocks. For this case, it makes more sense to assume
that the line is indented via tabs only, and consider the subsequent
alignment space as part of the line’s content. Since it’s hard to
imagine actual source code in which a mixed treatment of tabs and spaces
is desirable, I’m going with this over any more complex approach.
Previously, instantiating a TextEditor would always compute compute
screen lines twice: once when the DisplayBuffer was instantiated,
and once when the 'invisibles' property was set on the DisplayBuffer.
This is better behavior for alt-del/backspace operations, is less
"greedy" and doesn't eat up excess characters.
Also set default key mappings to these, feel free to trash my changes
to keymaps/darwin.cson. Though I do feel this should be default
behavior, personally.