diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-04-04 09:59:15 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-04-04 09:59:15 +0000 |
| commit | aa01521ff668f201ba4297bf0558a76835144cb5 (patch) | |
| tree | b6df7fa039b2d6751a943c1dab9bc2c8fe59190c /selection.h | |
| parent | input: hardcoded left mouse button handler requires click-count <= 3 (diff) | |
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.
Diffstat (limited to 'selection.h')
| -rw-r--r-- | selection.h | 1 |
1 files changed, 1 insertions, 0 deletions
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); |
