From: Michael D. Lowis Date: Wed, 5 Jul 2017 01:39:23 +0000 (-0400) Subject: fixed off-by-one error in line number column determination X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=d3d25cb9f39516d45de323a8f0dabd9024da8d14;p=projs%2Ftide.git fixed off-by-one error in line number column determination --- 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; }