From 6241b0122fda139cc22f14f9c21ca7289c4cde56 Mon Sep 17 00:00:00 2001 From: cpsdqs Date: Fri, 15 Sep 2017 08:32:43 +0200 Subject: [PATCH] Demo: Fix caret behaving strangely when in history --- js/demo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/demo.js b/js/demo.js index f05cb1f..aad4e36 100644 --- a/js/demo.js +++ b/js/demo.js @@ -816,7 +816,7 @@ class DemoShell { this.cursorPos-- if (this.cursorPos < 0) this.cursorPos = 0 } else if (action === 'move-cursor-x') { - this.cursorPos = Math.max(0, Math.min(this.history[0].length, this.cursorPos + args[0])) + this.cursorPos = Math.max(0, Math.min(this.history[this.historyIndex].length, this.cursorPos + args[0])) } else if (action === 'delete-line') { this.copyFromHistoryIndex() this.history[0] = ''