degesch: add an option to beep on highlight
This commit is contained in:
parent
3b42a09751
commit
c9b33846cb
10
degesch.c
10
degesch.c
|
@ -1443,6 +1443,10 @@ static struct config_schema g_config_behaviour[] =
|
||||||
.comment = "Don't leak messages from the server and global buffers",
|
.comment = "Don't leak messages from the server and global buffers",
|
||||||
.type = CONFIG_ITEM_BOOLEAN,
|
.type = CONFIG_ITEM_BOOLEAN,
|
||||||
.default_ = "off" },
|
.default_ = "off" },
|
||||||
|
{ .name = "beep_on_highlight",
|
||||||
|
.comment = "Beep when highlighted or on a new invisible PM",
|
||||||
|
.type = CONFIG_ITEM_BOOLEAN,
|
||||||
|
.default_ = "on" },
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2479,8 +2483,10 @@ log_formatter (struct app_context *ctx,
|
||||||
LIST_APPEND_WITH_TAIL (buffer->lines, buffer->lines_tail, line);
|
LIST_APPEND_WITH_TAIL (buffer->lines, buffer->lines_tail, line);
|
||||||
buffer->lines_count++;
|
buffer->lines_count++;
|
||||||
|
|
||||||
// TODO: beep if so configured and either the line is a highlight,
|
if (get_config_boolean (ctx->config.root, "behaviour.beep_on_highlight"))
|
||||||
// or the buffer is an inactive PM buffer
|
if ((flags & BUFFER_LINE_HIGHLIGHT)
|
||||||
|
|| (buffer->type == BUFFER_PM && buffer != ctx->current_buffer))
|
||||||
|
input_ding (&ctx->input);
|
||||||
|
|
||||||
if (buffer == ctx->current_buffer)
|
if (buffer == ctx->current_buffer)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue