]> git.mdlowis.com Git - projs/tide.git/commitdiff
buf_ins boolean flag should disable both copyindent *and* expand tabs. This ensures...
authorMichael D. Lowis <mike.lowis@gentex.com>
Mon, 5 Dec 2016 14:37:32 +0000 (09:37 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Mon, 5 Dec 2016 14:37:32 +0000 (09:37 -0500)
TODO.md
libedit/buf.c
xedit.c

diff --git a/TODO.md b/TODO.md
index 6d24c36ed75e11469d05d7a2cb041a7835184562..45b4a3f8d1aac27c1d14fdaebe3478b8056e4461 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -1,19 +1,17 @@
 # Implementation Tweaks and Bug Fixes
 
+* add tag for toggling expand tabs 
+* add tag for toggling auto indent
+* Expand tabs setting should be disabled if opened file contains tabs
+* Add tag for ctags lookup and line number jump
 * add a shortcut to autocomplete ctag
+* off by one error on scrolling up with wrapped lines
+* block selection should handle brace-balancing
 * Use select to check for error strings in exec.c
 * Should not be able to undo initial tag line text insertion
 * track down double click bug for selecting whole line
-* Add tag for ctags lookup
 * Implement minimal regex search (per Kernighan article)
 * Implement fuzzy file/buffer/tag picker
-* Implement omnicomplete pop-up
-* off by one error on scrolling up with wrapped lines
-* block selection should handle brace-balancing
-
-# Internals and Miscellaneous
-
-* Calculate line numbers and keep up to date while editing
 
 # Auxillary Programs
 
index f2f5e17840e1290e75c9de0cf62c1b0daad235aa..0e981e99d70cb1f161a685cce6ecafb31f33bb12 100644 (file)
@@ -168,9 +168,9 @@ static unsigned getindent(Buf* buf, unsigned off) {
     return buf_getcol(buf, off) / TabWidth;
 }
 
-unsigned buf_ins(Buf* buf, bool indent, unsigned off, Rune rune) {
+unsigned buf_ins(Buf* buf, bool fmt, unsigned off, Rune rune) {
     buf->modified = true;
-    if (buf->expand_tabs && rune == '\t') {
+    if (fmt && buf->expand_tabs && rune == '\t') {
         size_t n = (TabWidth - ((off - buf_bol(buf, off)) % TabWidth));
         log_insert(&(buf->undo), off, off+n);
         for(; n > 0; n--) insert(buf, off++, ' ');
@@ -178,7 +178,7 @@ unsigned buf_ins(Buf* buf, bool indent, unsigned off, Rune rune) {
         log_insert(&(buf->undo), off, off+1);
         insert(buf, off++, rune);
     }
-    if (indent && buf->copy_indent && (rune == '\n' || rune == RUNE_CRLF)) {
+    if (fmt && buf->copy_indent && (rune == '\n' || rune == RUNE_CRLF)) {
         unsigned indent = getindent(buf, off-1);
         for (; indent > 0; indent--)
             off = buf_ins(buf, indent, off, '\t');
diff --git a/xedit.c b/xedit.c
index 81abc1cc8381b6366f831787190909ef8cccc238..11edeb40f7267d19c4786b6459c25cb5123dbd95 100644 (file)
--- a/xedit.c
+++ b/xedit.c
@@ -113,6 +113,7 @@ static KeyBinding Bindings[] = {
 
     /* Standard Unix Shortcuts */
     { ModCtrl, 'u', del_to_bol  },
+    //{ ModCtrl, 'k', del_to_eol  },
     { ModCtrl, 'w', del_to_bow  },
     { ModCtrl, 'h', backspace   },
     { ModCtrl, 'a', cursor_home },