From 1255049e514dadfc151713b5f0b93e00ad5f3db2 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Mon, 25 Jan 2021 22:23:55 +0100 Subject: Do not fail in hinting if element clientRects could not be found. Fixes #659 --- CHANGELOG.md | 1 + src/scripts/hints.js | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc93dd9..9eafcfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. * Fixed crash in normal_focus_last_active (Thanks to Maxime Coste) * Fixed hint keys going to webview if the hinted element had no src-attribut (thanks to Maxime Coste) +* Fixed erro in hinting on gitlab which caused the hints to have ho labels #659. ### Removed * Expansion of `%` to the current opened URI for `:shellcmd` was removed because it breaks the `x-hint-command` with URIs containing '%'. But it is diff --git a/src/scripts/hints.js b/src/scripts/hints.js index fab48de..8917632 100644 --- a/src/scripts/hints.js +++ b/src/scripts/hints.js @@ -168,16 +168,19 @@ var hints = Object.freeze((function(){ continue; } - count++; - - /* create the hint label with number/letters */ rect = e.getClientRects()[0]; + if (!rect) { + continue; + } + + count++; label = labelTmpl.cloneNode(false); label.style.display = "none"; label.style.left = Math.max(rect.left - 4, 0) + "px"; label.style.top = Math.max(rect.top - 4, 0) + "px"; + /* create the hint label with number/letters */ /* if hinted element is an image - show title or alt of the image in hint label */ /* this allows to see how to filter for the image */ text = ""; -- cgit v1.2.3