}
static void insert_before(void) {
+ DotEnd = DotBeg;
Buffer.insert_mode = true;
}
static void insert_after(void) {
- DotEnd++;
+ DotBeg = ++DotEnd;
Buffer.insert_mode = true;
}
if (!Buffer.modified || num_clicks >= 2)
exit(0);
}
+
static void dot_delete(void) {
if (DotEnd == buf_end(&Buffer)) return;
size_t n = DotEnd - DotBeg;
Buffer.insert_mode = insert;
}
+static void dot_change(void) {
+ dot_delete();
+ Buffer.insert_mode = true;
+}
+
static void dot_backspace(void) {
if (DotBeg > 0 && DotBeg == DotEnd) DotBeg--;
while (DotBeg < DotEnd)
static void insert(Rune r) {
if (!Buffer.insert_mode) return;
buf_ins(&Buffer, DotEnd++, r);
+ DotBeg = DotEnd;
TargetCol = buf_getcol(&Buffer, DotEnd);
}
{ '0', cursor_bol },
{ '$', cursor_eol },
{ 'd', dot_delete },
+ { 'c', dot_change },
{ 0, NULL }
};