vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 666b9495b5d366abbf7590a82fa12912c9d4ea63 parent 10c0443ccc46285b8e767fbcb60b687bf3cf8d12 Author: Marc André Tanner <mat@brain-dump.org> Date: Tue, 9 Sep 2014 18:18:42 +0200 Add window borders in vertical layout Diffstat:
| M | vis.c | | | 6 | ++++-- |
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/vis.c b/vis.c @@ -67,11 +67,13 @@ static void vis_windows_arrange_vertical(Vis *vis) { int n = 0, x = 0, y = 0; for (VisWin *win = vis->windows; win; win = win->next) n++; - int width = vis->width / n; + int width = vis->width / n - 1; for (VisWin *win = vis->windows; win; win = win->next) { vis_window_resize(win, win->next ? width : vis->width - x, vis->height); vis_window_move(win, x, y); x += width; + if (win->next) + mvvline(0, x++, ACS_VLINE, vis->height); } } @@ -204,13 +206,13 @@ static void vis_window_draw(VisWin *win) { void vis_draw(Vis *vis) { erase(); - wnoutrefresh(stdscr); vis->windows_arrange(vis); for (VisWin *win = vis->windows; win; win = win->next) { if (vis->win != win) vis_window_draw(win); } vis_window_draw(vis->win); + wnoutrefresh(stdscr); } void vis_update(Vis *vis) {