Demo: Fix caret behaving strangely when in history

cpsdqs/unified-input
cpsdqs 7 years ago
parent 697918775d
commit 6241b0122f
Signed by untrusted user: cpsdqs
GPG Key ID: 3F59586BB7448DD1
  1. 2
      js/demo.js

@ -816,7 +816,7 @@ class DemoShell {
this.cursorPos-- this.cursorPos--
if (this.cursorPos < 0) this.cursorPos = 0 if (this.cursorPos < 0) this.cursorPos = 0
} else if (action === 'move-cursor-x') { } 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') { } else if (action === 'delete-line') {
this.copyFromHistoryIndex() this.copyFromHistoryIndex()
this.history[0] = '' this.history[0] = ''

Loading…
Cancel
Save