Up Next:
+* Update click time to 500ms
+* ignore the menu key or map it to control
+* clicking or dragging the mouse out of bounds should still update the selection
+* implement transaction control in buf.c
+* implement X resources config file
* highlight classes of identifiers
* Add a way to CD using a builtin (buffers will track original dir)
* shortcut to jump to previous edit
* add command line flags to toggle options (Tabs, Indent, etc..)
-* implement X resources config file
* move by words is inconsistent. Example:
var infoId = 'readerinfo'+reader.id;
size_t buf_insert(Buf* buf, bool fmt, size_t off, Rune rune) {
bool is_eol = (rune == '\n' || rune == RUNE_CRLF);
buf->modified = true;
- if (is_eol) buf->nlines++;
if (fmt && buf->expand_tabs && rune == '\t') {
size_t n = (TabWidth - ((off - buf_bol(buf, off)) % TabWidth));
log_insert(buf, &(buf->undo), off, off+n);
for (size_t i = end-beg; i > 0; i--) {
Rune r = buf_get(buf, beg);
bool is_eol = (r == '\n' || r == RUNE_CRLF);
- if (is_eol) buf->nlines--;
log_delete(buf, &(buf->undo), beg, &r, 1);
delete(buf, beg);
}
}
static void delete(Buf* buf, size_t off) {
+ Rune rune = buf_get(buf, off);
+ if (rune == RUNE_CRLF || rune == '\n')
+ buf->nlines--;
syncgap(buf, off);
buf->gapend++;
}
static size_t insert(Buf* buf, size_t off, Rune rune) {
size_t rcount = 1;
syncgap(buf, off);
+ if (rune == '\n') buf->nlines++;
if (buf->crlf && rune == '\n' && buf_get(buf, off-1) == '\r') {
rcount = 0;
*(buf->gapstart-1) = RUNE_CRLF;