Skip to content

Commit

Permalink
Merge pull request #10791 from tuga3d/indent-glitch-attempt-2
Browse files Browse the repository at this point in the history
second attempt on fixing the indent glitch.
  • Loading branch information
akien-mga authored Aug 31, 2017
2 parents 4722593 + 2eb4680 commit a717083
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scene/gui/text_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a717083

Please sign in to comment.