From aa01521ff668f201ba4297bf0558a76835144cb5 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 4 Apr 2020 11:59:15 +0200 Subject: selection: add selection_extend() This function extends an existing selection in the following way: If the extension point is *before* the upper boundary of the current selection, extend the selection upwards. If the extension point is *after* the bottom boundary of the current selection, extend the selection downwards. If the extension point is *inside* the current selection, shrink the selection such that the new size is maximized. This means we move the *closest* start/end point from in the current selection. --- selection.h | 1 + 1 file changed, 1 insertion(+) (limited to 'selection.h') diff --git a/selection.h b/selection.h index bc690eb1..5bc216e1 100644 --- a/selection.h +++ b/selection.h @@ -14,6 +14,7 @@ void selection_start( void selection_update(struct terminal *term, int col, int row); void selection_finalize(struct terminal *term, uint32_t serial); void selection_cancel(struct terminal *term); +void selection_extend(struct terminal *term, int col, int row, uint32_t serial); bool selection_on_row_in_view(const struct terminal *term, int row_no); -- cgit v1.3