I'm noticing various situations in which the automatic indentation in haml-mode does not what I expect it to do.
First issue:
Situation:
(using <> to denote my cursor position)
.element-a
some text
.element-b<>
When I press RET now, I would expect the following result:
.element-a
some text
.element-b
<>
What happens instead is this:
.element-a
some text
.element-b
<>
In words: the line I just wrote has become nested under the deepest context above it.
(my workaround for this is currently to press C-j TAB. It is strange that this even works, since C-j is bound to electric-newline-and-maybe-indent, which is the function I would expect to have the bahavior that haml-mode apparently attaches to newline)
Second issue:
Situation:
:javascript
function someFunction() {<>
When I now press RET, the situation becomes:
:javascript
function someFunction() {
<>
Pressing TAB now only allows me to step out of the :javascript block (to the left), not indent within it.
I would expect:
:javascript
function someFunction() {
<>
So far so good. But it becomes weirder.
Third issue:
:javascript
function someFunction() {
someCode();<>
(i.e. I manually indented the line with spaces and wrote a line)
Now when I press RET, the situation again becomes:
:javascript
function someFunction() {
someCode();
<>
In general what all those have in common is that haml-mode is altering the indentation of the line I am leaving, when it should at most change the indentation of the new line I am creating by pressing RET.
I'm noticing various situations in which the automatic indentation in haml-mode does not what I expect it to do.
First issue:
Situation:
(using
<>to denote my cursor position)When I press
RETnow, I would expect the following result:What happens instead is this:
In words: the line I just wrote has become nested under the deepest context above it.
(my workaround for this is currently to press
C-j TAB. It is strange that this even works, sinceC-jis bound toelectric-newline-and-maybe-indent, which is the function I would expect to have the bahavior that haml-mode apparently attaches tonewline)Second issue:
Situation:
When I now press
RET, the situation becomes:Pressing
TABnow only allows me to step out of the:javascriptblock (to the left), not indent within it.I would expect:
So far so good. But it becomes weirder.
Third issue:
(i.e. I manually indented the line with spaces and wrote a line)
Now when I press
RET, the situation again becomes:In general what all those have in common is that haml-mode is altering the indentation of the line I am leaving, when it should at most change the indentation of the new line I am creating by pressing
RET.