One thing that I broke in a recent pull request (probably #52) was preserving indentation between blank lines.
For example, suppose we have something like the following:
f = x -> (
x + 2)
We want the x + 2 indented since it's inside the parentheses. But currently, when Emacs is determining the indentation of the third line, it looks back to the second line, sees that there's nothing there, and figures that there should be no indentation. So we end up with:
f = x -> (
x + 2)
With this PR, we keep going back until we either hit a non-blank line or the beginning of the buffer to determine the indentation.
We also add a docstring to the M2-this-line-indent-amount function.
One thing that I broke in a recent pull request (probably #52) was preserving indentation between blank lines.
For example, suppose we have something like the following:
We want the
x + 2
indented since it's inside the parentheses. But currently, when Emacs is determining the indentation of the third line, it looks back to the second line, sees that there's nothing there, and figures that there should be no indentation. So we end up with:With this PR, we keep going back until we either hit a non-blank line or the beginning of the buffer to determine the indentation.
We also add a docstring to the
M2-this-line-indent-amount
function.Cc: @DanGrayson