+ maxJumps: 200,
+
+ /**
+ * Jump to the given offset in the jump stack.
+ *
+ * @param {number} offset The offset from the current position in
+ * the jump stack to jump to.
+ * @returns {number} The actual change in offset.
+ */
+ jump: function jump(offset) {
+ let store = buffer.localStore;
+ if (offset < 0 && store.jumpsIndex == store.jumps.length - 1)
+ this.push();
+
+ return this.withSavedValues(["jumping"], function _jump() {
+ this.jumping = true;
+ let idx = Math.constrain(store.jumpsIndex + offset, 0, store.jumps.length - 1);
+ let orig = store.jumpsIndex;
+
+ if (idx in store.jumps && !dactyl.trapErrors("_scrollTo", this, store.jumps[idx].mark))
+ store.jumpsIndex = idx;
+ return store.jumpsIndex - orig;
+ });
+ },
+
+ get jumps() {
+ let store = buffer.localStore;
+ return {
+ index: store.jumpsIndex,
+ locations: store.jumps.map(j => j.mark)
+ };
+ },
+