mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-30 11:10:23 -04:00
url-mode: for some reason we sorted the label letters before assigning them
Don't do this. Now that we **don't** sort them, the first letter chosen by the user is always assigned to the bottom most URL. Closes #2140 (again)
This commit is contained in:
parent
f873aa904d
commit
83303bd2a4
2 changed files with 5 additions and 12 deletions
|
|
@ -68,6 +68,11 @@
|
||||||
## Unreleased
|
## Unreleased
|
||||||
### Added
|
### Added
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
* The label letters are no longer sorted before being assigned to URLs
|
||||||
|
([#2140]2140[]).
|
||||||
|
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
### Removed
|
### Removed
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
||||||
12
url-mode.c
12
url-mode.c
|
|
@ -557,14 +557,6 @@ urls_collect(const struct terminal *term, enum url_action action,
|
||||||
remove_overlapping(urls, term->grid->num_cols);
|
remove_overlapping(urls, term->grid->num_cols);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
c32cmp_qsort_wrapper(const void *_a, const void *_b)
|
|
||||||
{
|
|
||||||
const char32_t *a = *(const char32_t **)_a;
|
|
||||||
const char32_t *b = *(const char32_t **)_b;
|
|
||||||
return c32cmp(a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
generate_key_combos(const struct config *conf,
|
generate_key_combos(const struct config *conf,
|
||||||
size_t count, char32_t *combos[static count])
|
size_t count, char32_t *combos[static count])
|
||||||
|
|
@ -607,10 +599,6 @@ generate_key_combos(const struct config *conf,
|
||||||
}
|
}
|
||||||
free(hints);
|
free(hints);
|
||||||
|
|
||||||
/* Sorting is a kind of shuffle, since we're sorting on the
|
|
||||||
* *reversed* strings */
|
|
||||||
qsort(combos, count, sizeof(char32_t *), &c32cmp_qsort_wrapper);
|
|
||||||
|
|
||||||
/* Reverse all strings */
|
/* Reverse all strings */
|
||||||
for (size_t i = 0; i < count; i++) {
|
for (size_t i = 0; i < count; i++) {
|
||||||
const size_t len = c32len(combos[i]);
|
const size_t len = c32len(combos[i]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue