]> git.mdlowis.com Git - projs/tide.git/commitdiff
fixed bug with trimming whitespace on last line of buffer
authorMichael D. Lowis <mike.lowis@gentex.com>
Wed, 26 Sep 2018 20:18:58 +0000 (16:18 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Wed, 26 Sep 2018 20:18:58 +0000 (16:18 -0400)
TODO.md
lib/buf.c

diff --git a/TODO.md b/TODO.md
index 92042ea263dc6cf2d6b134db8a612f4d8db624d7..6a4eccd6bfded52f91947e5d897749d927d4f200 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -2,12 +2,10 @@
 
 BUGS:
 
-* trimming does not use a transaction
-* trimming does not update selection properly
+* no magic right click
 * use transaction processing for joining lines
 * implement mouse warping on search, jump to line, and focus change
 * gap buffer does not handle UTF-8 currently
-* no magic right click
 * mouse selection handling when mouse moves outside region
 
 Up Next:
index 06dfe010816edca780d9e65958aefe1d8ac72747..d1adc38e3de4caadfcaee89b0401edf75ac8a27c 100644 (file)
--- a/lib/buf.c
+++ b/lib/buf.c
@@ -157,7 +157,7 @@ static void trim_whitespace(Buf* buf) {
     unsigned prev = 1;
     buf->selection.beg = buf->selection.end = 0;
     buf_logstart(buf);
-    while (buf->selection.end < buf_end(buf) && prev != buf->selection.end) {
+    while (prev != buf->selection.end) {
         int r = getb(buf, buf->selection.end);
         /* If we reached a newline, then delete whatever we have selected */
         if (r == '\r' || r == '\n') {