]> git.mdlowis.com Git - projs/tide.git/commitdiff
implemented first pass, slightly broken, copy indent
authorMichael D. Lowis <mike@mdlowis.com>
Fri, 14 Sep 2018 03:09:15 +0000 (23:09 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Fri, 14 Sep 2018 03:09:15 +0000 (23:09 -0400)
TODO.md
lib/view.c

diff --git a/TODO.md b/TODO.md
index 0629b97cc46540409c27d9981b81b2b3b860ff79..498088a8dbf7fc81a496d3d17fa410e0292db120 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -30,8 +30,6 @@ The Future:
 
 * Wily-like rc file for registering builtins
 * Case insensitive search
-* Ctrl+Up,Down requires two undos to revert.
-* Ctrl+Up,Down with non line selection should track column
 * use transaction ids to only mark buffer dirty when it really is
 * 100% coverage with unit and unit-integration tests
 * tab inserts dont coalesce like one would expect
@@ -40,10 +38,7 @@ The Future:
 
 Maybe think about addressing these later:
 
-* add current dir to path
-* add support for guidefiles
-* Shift+Insert should insert primary selection
-* Find shortcut should select previous word if current char is newline
+* add current dir to path]'\\\''''''''''''''''''''''''''''' char is newline
 
 # Auxillary Programs
 
index b7bbf7a1279a67330d1150ad7617f6019b5bf79b..f8ac1818da65fdb5b60256c4dca9ce8fb5e8fd8d 100644 (file)
@@ -263,6 +263,13 @@ void view_insert(View* view, Rune rune) {
         size_t off = buf_selbeg(BUF);
         size_t n = (TabWidth - ((off - buf_bol(BUF, off)) % TabWidth));
         for (; n > 0; n--) buf_putc(BUF, ' ');
+     } else if (CopyIndent && rune == '\n') {
+         size_t off = buf_selbeg(BUF);
+         size_t beg = buf_bol(BUF, off-1), end = beg;
+         for (; end < buf_end(BUF) && (' ' == buf_getrat(BUF, end) || '\t' == buf_getrat(BUF, end)); end++);
+        buf_putc(BUF, rune); 
+        for (; beg < end; beg++)
+             buf_putc(BUF, buf_getrat(BUF, beg));
     } else {
         buf_putc(BUF, rune);
     }