From: Michael D. Lowis Date: Wed, 7 Dec 2016 03:27:27 +0000 (-0500) Subject: moving right by word should not move past end of buffer X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=4660bcd81f6937497e9f4f97a1fc33ad632f0378;p=projs%2Ftide.git moving right by word should not move past end of buffer --- diff --git a/libedit/buf.c b/libedit/buf.c index 0e981e9..70c5030 100644 --- a/libedit/buf.c +++ b/libedit/buf.c @@ -406,7 +406,7 @@ unsigned buf_byword(Buf* buf, unsigned off, int count) { } else { for (; off < end && risword(buf_get(buf, off+1)); off++); for (; off < end && !risword(buf_get(buf, off+1)); off++); - off++; + if (off < buf_end(buf)) off++; } return off; }