From c7006661f5edc55cf235a647da67e0e26e7fe594 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 13 Feb 2021 11:43:28 +0100 Subject: url-mode: use ‘jump-label-letters’ as the alphabet for key sequences MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of hard coding the alphabet to “sadfjklewcmpgh”, use the letters from ‘jump-label-letters’. Closes #355 --- url-mode.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'url-mode.c') diff --git a/url-mode.c b/url-mode.c index 6aa7b4b8..df0f8fb8 100644 --- a/url-mode.c +++ b/url-mode.c @@ -353,11 +353,11 @@ wcscmp_qsort_wrapper(const void *_a, const void *_b) } static void -generate_key_combos(size_t count, wchar_t *combos[static count]) +generate_key_combos(const struct config *conf, + size_t count, wchar_t *combos[static count]) { - /* vimium default */ - static const wchar_t alphabet[] = L"sadfjklewcmpgh"; - static const size_t alphabet_len = ALEN(alphabet) - 1; + const wchar_t *alphabet = conf->jump_label_letters; + const size_t alphabet_len = wcslen(alphabet); size_t hints_count = 1; wchar_t **hints = xmalloc(hints_count * sizeof(hints[0])); @@ -410,14 +410,14 @@ generate_key_combos(size_t count, wchar_t *combos[static count]) } void -urls_assign_key_combos(url_list_t *urls) +urls_assign_key_combos(const struct config *conf, url_list_t *urls) { const size_t count = tll_length(*urls); if (count == 0) return; wchar_t *combos[count]; - generate_key_combos(count, combos); + generate_key_combos(conf, count, combos); size_t idx = 0; tll_foreach(*urls, it) -- cgit v1.3