mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-29 19:40:35 +00:00
improved the indentation in hstream
This commit is contained in:
parent
c1aac5e664
commit
4bac862e53
3
hyper.h
3
hyper.h
@ -4290,7 +4290,8 @@ inline void special_log(char c) { putchar(c); }
|
|||||||
|
|
||||||
struct logger : hstream {
|
struct logger : hstream {
|
||||||
int indentation;
|
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(); }
|
virtual char read_char() { throw hstream_exception(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user