From bc082b15b0d37ae911f3a02b5f3647adc33e8d81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=BCnter?= Date: Mon, 14 Oct 2019 07:39:56 +0200 Subject: [PATCH] Link Hints: fix start value calculation (#2970) * Link Hints: fix start value calculation * fix comment --- src/ui/zabapgit_js_common.w3mi.data.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ui/zabapgit_js_common.w3mi.data.js b/src/ui/zabapgit_js_common.w3mi.data.js index 8e922ac3e..4a9285f0a 100644 --- a/src/ui/zabapgit_js_common.w3mi.data.js +++ b/src/ui/zabapgit_js_common.w3mi.data.js @@ -827,8 +827,12 @@ function LinkHints(linkHintHotKey){ } LinkHints.prototype.getHintStartValue = function(targetsCount){ - // if we have 321 tooltips we start from 100 - var maxHintStringLength = targetsCount.toString().length; + // e.g. if we have 89 tooltips we start from 10 + // if we have 90 tooltips we start from 100 + // if we have 900 tooltips we start from 1000 + var + baseLength = Math.pow(10, targetsCount.toString().length - 1), + maxHintStringLength = (targetsCount + baseLength).toString().length; return Math.pow(10, maxHintStringLength - 1); };