1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-13 17:06:52 +00:00

improved the indentation in hstream

This commit is contained in:
Zeno Rogue 2018-11-30 14:45:53 +01:00
parent c1aac5e664
commit 4bac862e53

View File

@ -4290,7 +4290,8 @@ inline void special_log(char c) { putchar(c); }
struct logger : hstream {
int indentation;
virtual void write_char(char c) { special_log(c); if(c == 10) for(int i=0; i<indentation; i++) special_log(' '); }
bool doindent = false;
virtual void write_char(char c) { if(doindent) { doindent = false; for(int i=0; i<indentation; i++) special_log(' '); } special_log(c); if(c == 10) doindent = true; }
virtual char read_char() { throw hstream_exception(); }
};