From d3d25cb9f39516d45de323a8f0dabd9024da8d14 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Tue, 4 Jul 2017 21:39:23 -0400 Subject: [PATCH] fixed off-by-one error in line number column determination --- TODO.md | 28 ---------------------------- lib/win.c | 5 ++--- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/TODO.md b/TODO.md index da354ce..6fd6a81 100644 --- a/TODO.md +++ b/TODO.md @@ -82,31 +82,3 @@ Label, Conditional, Repeat, Character, Number, PreProc, Float, Operator, Structu Keyword GROUP [WORD...] Match GROUP REGEX Region GROUP start=REGEX skip=REGEX end=REGEX - -# Themes - -https://www.slant.co/topics/358/~best-color-themes-for-text-editors - -* Wily -* badwolf -* jelly beans -* one dark -* zenburn -* railscast -* material -* spacemacs -* inkpot -* soda light -* predawn -* lucario -* obsidian -* leuven -* afterglow -* nord -* plastic code wrap -* wombat -* noctilux -* deep space -* lean theme -* cheerfully dark -* gotham diff --git a/lib/win.c b/lib/win.c index 3f68dc6..5ba621d 100644 --- a/lib/win.c +++ b/lib/win.c @@ -159,9 +159,8 @@ void win_setscroll(double offset, double visible) { } static size_t gutter_cols(void) { - size_t len = (ShowLineNumbers ? 1 : 0), - lines = win_buf(EDIT)->nlines; - while (ShowLineNumbers && lines > 9) + size_t len = 0, lines = win_buf(EDIT)->nlines + 1; + while (ShowLineNumbers && lines) lines /= 10, len++; return len; } -- 2.49.0