aboutsummaryrefslogtreecommitdiffhomepage
path: root/desktop/sources/scripts/cursor.js
diff options
context:
space:
mode:
authorDevine Lu Linvega <[email protected]>2018-12-02 08:36:01 +1200
committerDevine Lu Linvega <[email protected]>2018-12-02 08:36:01 +1200
commit043157c2566d4367305f65b5e67d9f5c24fd1d8d (patch)
tree63c0b95a96933d32d3325b58e0d5ea39ad422f2e /desktop/sources/scripts/cursor.js
parente0b382956248c620ff697e72674601bad988c849 (diff)
downloadOrca-043157c2566d4367305f65b5e67d9f5c24fd1d8d.tar.gz
Orca-043157c2566d4367305f65b5e67d9f5c24fd1d8d.zip
Progress on undo/redo
Diffstat (limited to 'desktop/sources/scripts/cursor.js')
-rw-r--r--desktop/sources/scripts/cursor.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/desktop/sources/scripts/cursor.js b/desktop/sources/scripts/cursor.js
index 0eac526..8d7e404 100644
--- a/desktop/sources/scripts/cursor.js
+++ b/desktop/sources/scripts/cursor.js
@@ -53,12 +53,14 @@ function Cursor (orca, terminal) {
if (this.mode === 1) {
this.move(1, 0)
}
+ terminal.history.record()
}
this.erase = function (g) {
if (this.w === 1 && this.h === 1 && orca.glyphAt(this.x, this.y) === '.') { this.move(-1, 0); return } // Backspace Effect
this.eraseBlock(this.x, this.y, this.w, this.h)
this.reset()
+ terminal.history.record()
}
this.toggleMode = function () {
@@ -98,6 +100,7 @@ function Cursor (orca, terminal) {
}
_y++
}
+ terminal.history.record()
}
this.eraseBlock = function (x, y, w, h) {
@@ -106,6 +109,7 @@ function Cursor (orca, terminal) {
orca.write(_x, _y, '.')
}
}
+ terminal.history.record()
}
function clamp (v, min, max) { return v < min ? min : v > max ? max : v }