Pressing return with cursor at start of line surprisingly removes initial whitespace


#1

If I have this situation, where | indicates the cursor:

    typescript:
|     taskmanager:
        src: ['src/taskmanager/taskmanager.ts']
        dest: 'build/'

And then I press return key, I get to this:

    typescript:
   
|taskmanager:
        src: ['src/taskmanager/taskmanager.ts']
        dest: 'build/'

Which is pretty surprising, and can be quite annoying because I then have to re-indent the line.

(I know I can use cmd-shift-return to insert a line above, but then my cursor is on a different line, not the one I wanted, and on pretty much every other editor, I think, the above doesn’t happen)

Thoughts? Can we fix it? :slight_smile:


#2

Can you post a gist of the file and let me know what language grammar is being used? I can try and reproduce this bug.


#3

It happens in all JavaScript and TypeScript files. It will happen if you copy/paste the stuff above. :slight_smile: