diff --git a/tests/end2end/data/hints/short_dict.html b/tests/end2end/data/hints/short_dict.html
new file mode 100644
index 000000000..9c2140315
--- /dev/null
+++ b/tests/end2end/data/hints/short_dict.html
@@ -0,0 +1,13 @@
+
+
+
+
+
+ Many links
+
+
+ 1
+ 2
+ 3
+
+
diff --git a/tests/end2end/test_hints_html.py b/tests/end2end/test_hints_html.py
index 58a19eb21..ef2e4f725 100644
--- a/tests/end2end/test_hints_html.py
+++ b/tests/end2end/test_hints_html.py
@@ -113,3 +113,20 @@ def test_word_hints_issue1393(quteproc, tmpdir):
quteproc.wait_for(message='hints: *', category='hints')
quteproc.send_cmd(':follow-hint {}'.format(hint))
quteproc.wait_for_load_finished('data/{}'.format(target))
+
+
+def test_short_dict(quteproc, tmpdir):
+ dict_file = tmpdir / 'dict'
+ dict_file.write(textwrap.dedent("""
+ worda
+ wordb
+ """))
+ quteproc.set_setting('hints', 'mode', 'word')
+ quteproc.set_setting('hints', 'dictionary', str(dict_file))
+ quteproc.open_path('data/hints/short_dict.html')
+ quteproc.send_cmd(':hint')
+ line = quteproc.wait_for(message='Not enough words in the dictionary.')
+ line.expected = True
+ quteproc.wait_for(message='hints: *', category='hints')
+ quteproc.send_cmd(':follow-hint d')
+ quteproc.wait_for_load_finished('data/hello3.txt')