Fix #27505: Text Editor always indent next line when a " is found (which is not always correct)

Do not indent if there's any non-space character after colon.

This only makes life a bit easier, but it's still not 100% correct indentation
strategy. For example when colon is inside non-closed string or so.
Also there's not indentation for { and un-indentation for }.

Handling such cases would require much smarter strategy..
This commit is contained in:
Sergey Sharybin 2011-05-28 14:40:42 +00:00
parent ce8467ffd3
commit 628a8151da

@ -2759,7 +2759,7 @@ int setcurr_tab_spaces (Text *text, int space)
break;
} else if (ch==':') {
is_indent = 1;
} else if (ch==']' || ch=='}' || ch=='"' || ch=='\'') {
} else if (ch!=' ' && ch!='\t') {
is_indent = 0;
}
}