From d8258bf3d3c14a3462e6f335796b4c85489f7857 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Fri, 2 Dec 2016 13:59:23 -0500 Subject: [PATCH] Fixed a bug with copyindent where it only copied indent from lines with non-whitespace content --- TODO.md | 1 - libedit/buf.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) 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; } -- 2.52.0