degesch: sort modes on change
This commit is contained in:
parent
de2eff7399
commit
5bc259e388
@ -4000,6 +4000,12 @@ mode_processor_run (struct mode_processor *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
mode_char_cmp (const void *a, const void *b)
|
||||||
|
{
|
||||||
|
return *(const char *) a - *(const char *) b;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mode_processor_toggle (struct mode_processor *self, struct str *modes)
|
mode_processor_toggle (struct mode_processor *self, struct str *modes)
|
||||||
{
|
{
|
||||||
@ -4010,7 +4016,7 @@ mode_processor_toggle (struct mode_processor *self, struct str *modes)
|
|||||||
if (self->adding)
|
if (self->adding)
|
||||||
{
|
{
|
||||||
str_append_c (modes, self->mode_char);
|
str_append_c (modes, self->mode_char);
|
||||||
// TODO: sort the modes
|
qsort (modes->str, modes->len, 1, mode_char_cmp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
str_remove_slice (modes, pos - modes->str, 1);
|
str_remove_slice (modes, pos - modes->str, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user