чување 0953ecfcef6999c77c99420c67f55daf2bf6e0eb
родитељ 0087f2e07b704cbbd83b5faf1f560e20c56f9d74
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Wed, 16 Feb 2022 16:08:12 +0100
sled.c: Remove debug code; fix clearing selection
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 1, додавања: 8(+), брисања: 9(-)
diff --git a/sled.c b/sled.c
@@ -846,13 +846,16 @@ cancel_close(struct DrawState* state)
if (!state)
return 1;
- if (!*state->error && !state->in_prompt && !state->show_help
- && !state->in_selection_mode)
- strcpy(state->error, errors[ERR_EXIT_KEY]);
- else
+ if (!*state->error && !state->in_prompt && !state->show_help)
{
- if (!state->show_help && !state->in_prompt && !*state->error)
+ if ((state->sel_start_row != state->sel_end_row)
+ || state->sel_start_col != state->sel_end_col)
clear_selection(state);
+ else
+ strcpy(state->error, errors[ERR_EXIT_KEY]);
+ }
+ else
+ {
*state->error = 0;
*state->prompt = 0;
state->in_prompt = 0;
@@ -1255,10 +1258,6 @@ main(int argc, char** argv)
tb_init();
*error = 0;
state.maxx = 0;
- state.sel_start_row = 1;
- state.sel_start_col = 3;
- state.sel_end_row = 1;
- state.sel_end_col = 6;
while (state.running)
{