aboutsummaryrefslogtreecommitdiff
path: root/sherlock_nk.c
diff options
context:
space:
mode:
Diffstat (limited to 'sherlock_nk.c')
-rw-r--r--sherlock_nk.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sherlock_nk.c b/sherlock_nk.c
index 65233b5..d82c357 100644
--- a/sherlock_nk.c
+++ b/sherlock_nk.c
@@ -224,7 +224,7 @@ _clear(plughandle_t *handle)
_clear_items(handle);
nk_str_clear(&handle->str);
handle->selected = NULL;
- handle->counter = 0;
+ handle->counter = 1;
}
void
@@ -430,14 +430,16 @@ port_event(LV2UI_Handle instance, uint32_t i, uint32_t size, uint32_t urid,
}
case 2:
{
- if(handle->state.block)
+ const bool overflow = handle->n_item > MAX_LINES;
+
+ if(overflow && handle->state.overwrite)
{
- break;
+ _clear(handle);
}
- if( (handle->n_item > MAX_LINES) && handle->state.overwrite)
+ if(overflow || handle->state.block)
{
- _clear(handle);
+ break;
}
const LV2_Atom *atom = buf;