Change:
Issue Type: <bBug</bPlease look this, ! Line 2: "Text" Line 3: .... This is auto indent line. ? (:, : ) ABC
I update this issue. But, It is automaticaly closed. Why? Please look this updated isuue.
What are the steps to reproduce? What is happening versus what you would expect to happen?
First line is, ( is white space, is Tab code) "Text" + -key Actual input is: (The above procedure removes the white space.) [Tab]-key, "Text", (move coursor position to the beginning of line), [Space][Space], (move coursor position to end of line), [Enter] The next cursor position is invalid. Please look the image of issue. I think, this is not serious but incorrect behavior.
Thank you for the extra information. Here are simplified steps: have a file with the contents press <kbdEnter</kbdif indentation is configured with tabs, the new line will contain if indentation is configured with spaces, the new line will contain
Thanks.
can we have some verification steps?
Posting again with more explanations: have a file with the contents press <kbdEnter</kbdif indentation is configured with tabs, the new line will contain . <---- this is a bug, the result should be such that the second line aligns with the first line if indentation is configured with spaces, the new line will contain <--- this is a bug, the result should be such that the second line aligns with the first line

Discussion:
*--------------------------------------------------------------------------------------------*/ import * as strings from 'vs/base/common/strings'; <ins> import { CursorColumns } from 'vs/editor/common/core/cursorColumns'; </ins> function _normalizeIndentationFromWhitespace(str: string, indentSize: number, insertSpaces: boolean): string { let spacesCnt = 0; for (let i = 0; i < str.length; i++) { if (str.charAt(i) === 't') { <del> spacesCnt += indentSize; </del> <ins> spacesCnt = CursorColumns.nextIndentTabStop(spacesCnt, indentSize); </ins> } else { spacesCnt++; }

assertNormalized(new Position(1, 1), 'foorbar', 'foonbar'); assertNormalized(new Position(1, 1), 'foorbar', 'foonbar'); assertNormalized(new Position(2, 5), 'foortbar', 'foon        bar'); <del> assertNormalized(new Position(2, 3), 'foortbar', 'foon      bar'); </del> <ins> assertNormalized(new Position(2, 3), 'foortbar', 'foon    bar'); </ins> assertNormalized(new Position(2, 5), 'foortbarnfoo', 'foon        barn    foo'); //Indentation issue with choice elements that span multiple lines #46266

}); }); <ins> test('issue #148256: Pressing Enter creates line with bad indent with insertSpaces: true', () => { usingCursor({ text: [ '  t' ], }, (editor, model, viewModel) => { moveTo(editor, viewModel, 1, 4, false); viewModel.type('n', 'keyboard'); assert.strictEqual(model.getValue(), '  tn    '); }); }); test('issue #148256: Pressing Enter creates line with bad indent with insertSpaces: false', () => { usingCursor({ text: [ '  t' ] }, (editor, model, viewModel) => { model.updateOptions({ insertSpaces: false }); moveTo(editor, viewModel, 1, 4, false); viewModel.type('n', 'keyboard'); assert.strictEqual(model.getValue(), '  tnt'); }); }); </ins> test('removeAutoWhitespace off', () => { usingCursor({ text: [

assert.strictEqual(model.normalizeIndentation('  '), '  '); assert.strictEqual(model.normalizeIndentation(' '), ' '); assert.strictEqual(model.normalizeIndentation(''), ''); <del> assert.strictEqual(model.normalizeIndentation(' t   '), 'tt'); assert.strictEqual(model.normalizeIndentation(' t  '), 't   '); assert.strictEqual(model.normalizeIndentation(' t '), 't  '); assert.strictEqual(model.normalizeIndentation(' t'), 't '); </del> <ins> assert.strictEqual(model.normalizeIndentation(' t    '), 'tt'); assert.strictEqual(model.normalizeIndentation(' t   '), 't   '); assert.strictEqual(model.normalizeIndentation(' t  '), 't  '); assert.strictEqual(model.normalizeIndentation(' t '), 't '); assert.strictEqual(model.normalizeIndentation(' t'), 't'); </ins> assert.strictEqual(model.normalizeIndentation('ta'), 'ta'); assert.strictEqual(model.normalizeIndentation('    a'), 'ta');

assert.strictEqual(model.normalizeIndentation('  a'), '  a'); assert.strictEqual(model.normalizeIndentation(' a'), ' a'); assert.strictEqual(model.normalizeIndentation('a'), 'a'); <del> assert.strictEqual(model.normalizeIndentation(' t   a'), 'tta'); assert.strictEqual(model.normalizeIndentation(' t  a'), 't   a'); assert.strictEqual(model.normalizeIndentation(' t a'), 't  a'); assert.strictEqual(model.normalizeIndentation(' ta'), 't a'); </del> <ins> assert.strictEqual(model.normalizeIndentation(' t    a'), 'tta'); assert.strictEqual(model.normalizeIndentation(' t   a'), 't   a'); assert.strictEqual(model.normalizeIndentation(' t  a'), 't  a'); assert.strictEqual(model.normalizeIndentation(' t a'), 't a'); assert.strictEqual(model.normalizeIndentation(' ta'), 'ta'); </ins> model.dispose(); });

assert.strictEqual(model.normalizeIndentation('  a'), '  a'); assert.strictEqual(model.normalizeIndentation(' a'), ' a'); assert.strictEqual(model.normalizeIndentation('a'), 'a'); <del> assert.strictEqual(model.normalizeIndentation(' t   a'), '        a'); assert.strictEqual(model.normalizeIndentation(' t  a'), '       a'); assert.strictEqual(model.normalizeIndentation(' t a'), '      a'); assert.strictEqual(model.normalizeIndentation(' ta'), '     a'); </del> <ins> assert.strictEqual(model.normalizeIndentation(' t    a'), '        a'); assert.strictEqual(model.normalizeIndentation(' t   a'), '       a'); assert.strictEqual(model.normalizeIndentation(' t  a'), '      a'); assert.strictEqual(model.normalizeIndentation(' t a'), '     a'); assert.strictEqual(model.normalizeIndentation(' ta'), '    a'); </ins> model.dispose(); });