Allow mixed tabs and spaces when indentation does not depend on tab size

(hopefully) Closes #30937, fixes #32612
This commit is contained in:
Bojidar Marinov 2019-10-13 22:48:18 +03:00
parent d0628180ae
commit afbde3314a
No known key found for this signature in database
GPG key ID: 4B0FD31949AD430D
4 changed files with 103 additions and 78 deletions

View file

@ -552,7 +552,27 @@ private:
int pending_newline;
List<int> tab_level;
struct IndentLevel {
int indent;
int tabs;
bool is_mixed(IndentLevel other) {
return (
(indent == other.indent && tabs != other.tabs) ||
(indent > other.indent && tabs < other.tabs) ||
(indent < other.indent && tabs > other.tabs));
}
IndentLevel() :
indent(0),
tabs(0) {}
IndentLevel(int p_indent, int p_tabs) :
indent(p_indent),
tabs(p_tabs) {}
};
List<IndentLevel> indent_level;
String base_path;
String self_path;