From 7afc6af9d2dbe5af72ad7b8308b74dad245559c0 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 29 Dec 2022 11:15:45 +0100 Subject: [PATCH] Fix regression in truncating PV. --- www/js/remoteglot.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index 5314a56..c2bf8ff 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -734,6 +734,7 @@ function print_pv(line_num, splicepos, opt_limit, opt_showlast) { let ret = document.createDocumentFragment(); let in_tb = false; + let i = 0; if (opt_limit && opt_showlast && pv.length > opt_limit) { // Truncate the PV at the beginning (instead of at the end). // We assume here that toplay is 'W'. We also assume that if @@ -754,7 +755,7 @@ function print_pv(line_num, splicepos, opt_limit, opt_showlast) { } else if (toplay == 'B' && pv.length > 0) { ret.appendChild(document.createTextNode(move_num + '. … ')); } - for (let i = 0; i < pv.length; ++i) { + for (; i < pv.length; ++i) { let link = document.createElement('a'); link.className = 'move'; link.setAttribute('id', 'automove' + line_num + '-' + i); -- 2.39.2