|
@@ -16,6 +16,7 @@ void keybind_delete_word(struct app *app, enum keybind_dir dir);
|
|
|
|
|
|
|
|
void keybind_mv_cur_line(struct app *app, enum keybind_dir dir);
|
|
void keybind_mv_cur_line(struct app *app, enum keybind_dir dir);
|
|
|
void keybind_mv_cur_edg_line(struct app *app, enum keybind_dir dir);
|
|
void keybind_mv_cur_edg_line(struct app *app, enum keybind_dir dir);
|
|
|
|
|
+void keybind_delete_line(struct app *app, enum keybind_dir dir);
|
|
|
void keybind_delete_to_edg_line(struct app *app, enum keybind_dir dir);
|
|
void keybind_delete_to_edg_line(struct app *app, enum keybind_dir dir);
|
|
|
|
|
|
|
|
void keybind_insert_newline(struct app *app, enum keybind_dir dir);
|
|
void keybind_insert_newline(struct app *app, enum keybind_dir dir);
|
|
@@ -175,6 +176,20 @@ keybind_mv_cur_edg_line(struct app *app, enum keybind_dir dir)
|
|
|
app->cbuf->high_col = buffer_calc_cur_col(app->cbuf);
|
|
app->cbuf->high_col = buffer_calc_cur_col(app->cbuf);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+void
|
|
|
|
|
+keybind_delete_line(struct app *app, enum keybind_dir dir)
|
|
|
|
|
+{
|
|
|
|
|
+ (void) dir;
|
|
|
|
|
+ struct buffer_line l = buffer_find_line(app->cbuf, app->cbuf->cur);
|
|
|
|
|
+ enum buffer_err err;
|
|
|
|
|
+ l.end += (l.end+1 < app->cbuf->data.size);
|
|
|
|
|
+ buffer_remove_between(app->cbuf, l.start, l.end, &err);
|
|
|
|
|
+ if ( err != BUFFER_ERR_OK ) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ app->cbuf->high_col = buffer_calc_cur_col(app->cbuf);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
void
|
|
void
|
|
|
keybind_delete_to_edg_line(struct app *app, enum keybind_dir dir)
|
|
keybind_delete_to_edg_line(struct app *app, enum keybind_dir dir)
|
|
|
{
|
|
{
|