From: Steinar H. Gunderson Date: Thu, 29 Dec 2022 10:15:45 +0000 (+0100) Subject: Fix regression in truncating PV. X-Git-Url: https://git.sesse.net/?p=remoteglot;a=commitdiff_plain;h=7afc6af9d2dbe5af72ad7b8308b74dad245559c0 Fix regression in truncating PV. --- 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);