BUGS:
+* use transaction processing for joining lines
* no analysis of line-endings or tabs in document
* no copy indent
* add arguments to keybindings
void view_byline(View* view, int move, bool extsel);
char* view_fetch(View* view, size_t row, size_t col, bool (*isword)(Rune));
bool view_findstr(View* view, int dir, char* str);
-void view_insert(View* view, bool indent, Rune rune);
+void view_insert(View* view, Rune rune);
void view_delete(View* view, int dir, bool byword);
void view_bol(View* view, bool extsel);
void view_eol(View* view, bool extsel);
return found;
}
-void view_insert(View* view, bool indent, Rune rune) {
+void view_insert(View* view, Rune rune) {
/* ignore non-printable control characters */
if (!isspace(rune) && (rune >= 0 && rune < 0x20))
return;
/* fallback to just inserting the rune if it doesn't fall in the private use area.
* the private use area is used to encode special keys */
if (key < 0xE000 || key > 0xF8FF)
- view_insert(win_view(FOCUSED), true, key);
+ view_insert(win_view(FOCUSED), key);
}
static void xbtnpress(XEvent* e) {
for (; r == '\t' || r == ' '; r = view_getrune(view))
view_byrune(view, RIGHT, true);
if (r != '\n')
- view_insert(view, false, ' ');
+ buf_putc(win_buf(FOCUSED), ' ');
}
static void delete(char* arg) {
view_bol(view, false);
}
view_eol(view, false);
- view_insert(view, true, '\n');
+ view_insert(view, '\n');
}
static void highlight(char* arg) {