Merge pull request #10791 from tuga3d/indent-glitch-attempt-2
second attempt on fixing the indent glitch.
This commit is contained in:
commit
a717083235
1 changed files with 3 additions and 3 deletions
|
@ -2113,15 +2113,15 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
|||
|
||||
//keep indentation
|
||||
int space_count = 0;
|
||||
for (int i = 0; i < text[cursor.line].length(); i++) {
|
||||
if (text[cursor.line][i] == '\t' && cursor.column > 0) {
|
||||
for (int i = 0; i < cursor.column; i++) {
|
||||
if (text[cursor.line][i] == '\t') {
|
||||
if (indent_using_spaces) {
|
||||
ins += space_indent;
|
||||
} else {
|
||||
ins += "\t";
|
||||
}
|
||||
space_count = 0;
|
||||
} else if (text[cursor.line][i] == ' ' && cursor.column > 0) {
|
||||
} else if (text[cursor.line][i] == ' ') {
|
||||
space_count++;
|
||||
|
||||
if (space_count == indent_size) {
|
||||
|
|
Loading…
Reference in a new issue