Skip to content

in Studio Editor AutoIndentation: on Enter new Line more Space or Tab added, line len grows with every blank Char behind cursor #33

@ChristianEngel19820128

Description

@ChristianEngel19820128

In Studio Editor if you type a space or tab and behind it a letter, Chars in Line grow with each Enter, when the cursor is left to the blank Char. The Letter is only to make it visible and it happens without it. After an hour look into and read the code I found the position and reason.

If I'am right then the Cursor Position is not checked in For loop. All the space or tab will push back to the new line and added again to the new line after that with the hanging text behind the cursor. So the blank Chars behind the cursor will duplicated on Enter and the line length grows.

TextEditor.cpp On Line: 6162

if (pref.bAutoIndentation) // mLanguageDefinition.mAutoIndentation
{
	for (size_t it = 0; it < line.size() && isblank((unsigned char)line[it].mChar); ++it) {
		newLine.push_back(line[it]);
		if (iTotalAdd < MAX_PATH - 1) {
			cTotalAdded[iTotalAdd++] = line[it].mChar;
			cTotalAdded[iTotalAdd] = 0;
		}
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions