micro/src/statusline.d

31 lines
679 B
D
Raw Normal View History

2016-03-11 02:06:06 +00:00
import termbox;
import view;
import std.conv: to;
2016-03-11 02:06:06 +00:00
class StatusLine {
View view;
this() { }
void update() {
}
void display() {
int y = height() - 2;
string file = view.buf.name;
if (view.buf.toString != view.buf.savedText) {
file ~= " +";
}
file ~= " (" ~ to!string(view.cursor.y) ~ "," ~ to!string(view.cursor.x) ~ ")";
2016-03-11 02:06:06 +00:00
foreach (x; 0 .. width()) {
if (x >= 1 && x < 1 + file.length) {
setCell(x, y, cast(uint) file[x - 1], Color.black, Color.blue);
2016-03-11 02:06:06 +00:00
} else {
setCell(x, y, ' ', Color.black, Color.blue);
2016-03-11 02:06:06 +00:00
}
}
}
}