From bce301363fbe0d76b0586e14209eef1ce421fd59 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Mon, 5 Jun 2017 12:00:58 -0400 Subject: [PATCH] edit region columns should shrink when gutter is enabled --- lib/win.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/win.c b/lib/win.c index d3d9274..557a01c 100644 --- a/lib/win.c +++ b/lib/win.c @@ -143,14 +143,14 @@ void win_setscroll(double offset, double visible) { } static size_t gutter_cols(void) { - size_t len = 1, lines = win_buf(EDIT)->nlines; + size_t len = (LineNumbers ? 1 : 0), + lines = win_buf(EDIT)->nlines; while (LineNumbers && lines > 9) lines /= 10, len++; return len; } static size_t gutter_size(void) { - if (!LineNumbers) return 0; return (gutter_cols() * x11_font_width(Font)) + (LineNumbers ? 5 : 0); } @@ -193,7 +193,7 @@ static void layout(int width, int height) { Regions[EDIT].y = 5 + Regions[TAGS].y + Regions[TAGS].height; Regions[EDIT].height = (height - Regions[EDIT].y - 5); Regions[EDIT].width = width - Regions[SCROLL].width - 5; - view_resize(editview, Regions[EDIT].height / fheight, Regions[EDIT].width / fwidth); + view_resize(editview, Regions[EDIT].height / fheight, Regions[EDIT].width / fwidth - gutter_cols()); } static void onredraw(int width, int height) { -- 2.51.0