From 2a531327dde3c86edea2baf9503d08545d8f4767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 4 Jan 2020 12:09:09 +0100 Subject: [PATCH] selection: selection_cancel() now sets 'kind' to SELECTION_NONE --- selection.c | 5 +++++ terminal.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/selection.c b/selection.c index 1510210e..b9f4579e 100644 --- a/selection.c +++ b/selection.c @@ -126,6 +126,10 @@ foreach_selected( case SELECTION_BLOCK: return foreach_selected_block(term, cb, data); + + case SELECTION_NONE: + assert(false); + return; } assert(false); @@ -319,6 +323,7 @@ selection_cancel(struct terminal *term) render_refresh(term); } + term->selection.kind = SELECTION_NONE; term->selection.start = (struct coord){-1, -1}; term->selection.end = (struct coord){-1, -1}; } diff --git a/terminal.h b/terminal.h index 4bc4d092..9d28ff41 100644 --- a/terminal.h +++ b/terminal.h @@ -158,7 +158,7 @@ enum mouse_reporting { enum cursor_style { CURSOR_BLOCK, CURSOR_UNDERLINE, CURSOR_BAR }; -enum selection_kind { SELECTION_NORMAL, SELECTION_BLOCK }; +enum selection_kind { SELECTION_NONE, SELECTION_NORMAL, SELECTION_BLOCK }; struct ptmx_buffer { void *data;