# Implementation Tweaks and Bug Fixes
+* Indent on first line of buffer causes infinite loop
* block selection should handle brace-balancing
* Add tag for ctags lookup and line number jump
* add a shortcut to autocomplete ctag
Nice to haves:
+* focus should follow mouse between regions
* Expand tabs setting should be disabled if opened file contains tabs
* Add a tools dir to namespace utility scripts only useful inside the editor
* shift+click to extend selection
buf->redo = NULL;
}
-static unsigned getindent(Buf* buf, unsigned off) {
- off = buf_bol(buf, off);
- for (; off < buf_end(buf) && (' ' == buf_get(buf, off) || '\t' == buf_get(buf, off)); off++);
- return buf_getcol(buf, off) / TabWidth;
-}
-
static void delete(Buf* buf, unsigned off) {
syncgap(buf, off);
buf->gapend++;
}
}
if (fmt && buf->copy_indent && (rune == '\n' || rune == RUNE_CRLF)) {
- unsigned indent = getindent(buf, off-1);
- for (; indent > 0; indent--)
- off = buf_insert(buf, indent, off, '\t');
+ unsigned beg = buf_bol(buf, off-1), end = beg;
+ for (; end < buf_end(buf) && (' ' == buf_get(buf, end) || '\t' == buf_get(buf, end)); end++);
+ for (; beg < end; beg++)
+ off = buf_insert(buf, true, off, buf_get(buf, beg));
}
clear_redo(buf);
return off;