1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-13 08:45:45 +01:00

Initial work towards making <C-o> and <C-i> more Vim-like.

This commit is contained in:
Kris Maglione
2011-08-07 18:56:38 -04:00
parent 84a69b920a
commit 3aa12ba117
7 changed files with 135 additions and 62 deletions

View File

@@ -270,11 +270,18 @@ var Buffer = Module("buffer", {
* tab.
*/
get localStore() {
if (!content.document.dactylStore)
content.document.dactylStore = {};
return content.document.dactylStore;
let doc = content.document;
if (!doc.dactylStore || !buffer.localStorePrototype.isPrototypeOf(doc.dactylStore))
doc.dactylStore = Object.create(buffer.localStorePrototype);
return doc.dactylStore.instance = doc.dactylStore;
},
localStorePrototype: memoize({
instance: {},
get jumps() [],
jumpsIndex: 0
}),
/**
* @property {Node} The last focused input field in the buffer. Used
* by the "gi" key binding.
@@ -1263,9 +1270,8 @@ var Buffer = Module("buffer", {
* null, to not alter the vertical scroll offset.
*/
scrollTo: function scrollTo(elem, left, top) {
// Temporary hack. Should be done better.
if (elem.ownerDocument == buffer.focusedFrame.document)
marks.add("'");
marks.push();
if (left != null)
elem.scrollLeft = left;