From: Michael D. Lowis Date: Fri, 2 Dec 2016 18:59:23 +0000 (-0500) Subject: Fixed a bug with copyindent where it only copied indent from lines with non-whitespac... X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=d8258bf3d3c14a3462e6f335796b4c85489f7857;p=projs%2Ftide.git Fixed a bug with copyindent where it only copied indent from lines with non-whitespace content --- diff --git a/TODO.md b/TODO.md index 0f82b23..d05a861 100644 --- a/TODO.md +++ b/TODO.md @@ -38,4 +38,3 @@ * Spell checker integration * Syntax highlighting * Implement full featured regex engine - diff --git a/libedit/buf.c b/libedit/buf.c index 0d7553d..d0e38c0 100644 --- a/libedit/buf.c +++ b/libedit/buf.c @@ -156,7 +156,7 @@ static void clear_redo(Buf* buf) { static unsigned getindent(Buf* buf, unsigned off) { off = buf_bol(buf, off); - for (; off < buf_end(buf) && isspace(buf_get(buf, off)); off++); + for (; off < buf_end(buf) && (' ' == buf_get(buf, off) || '\t' == buf_get(buf, off)); off++); return buf_getcol(buf, off) / TabWidth; }