From c500936b2e7d218b66d01e68191e04b72d398061 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sun, 2 Oct 2011 14:56:18 -0400 Subject: [PATCH] Fix buffer.jsm bugs. --- common/modules/buffer.jsm | 9 +++++---- common/modules/main.jsm | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/common/modules/buffer.jsm b/common/modules/buffer.jsm index 8f053dcc..cdd13da0 100644 --- a/common/modules/buffer.jsm +++ b/common/modules/buffer.jsm @@ -1754,7 +1754,7 @@ var Buffer = Module("Buffer", { events.listen(config.browser, "scroll", buffer.closure._updateBufferPosition, false); }, mappings: function initMappings(dactyl, modules, window) { - let { Events, buffer, ex, mappings, modes, options, tabs } = modules; + let { Editor, Events, buffer, events, ex, mappings, modes, options, tabs } = modules; mappings.add([modes.NORMAL], ["y", ""], "Yank current location to the clipboard", @@ -1835,8 +1835,9 @@ var Buffer = Module("Buffer", { "Go to the end of the document", function (args) { if (args.count) - var elem = options.get("linenumbers").getLine(buffer.focusedFrame.document, - args.count); + var elem = options.get("linenumbers") + .getLine(buffer.focusedFrame.document, + args.count); if (elem) elem.scrollIntoView(true); else if (args.count) @@ -2094,7 +2095,7 @@ var Buffer = Module("Buffer", { "string", "UTF-8", { scope: Option.SCOPE_LOCAL, - getter: function () config.browser.docShell.QueryInterface(Ci.nsIDocCharset).charset, + getter: function () buffer.docShell.QueryInterface(Ci.nsIDocCharset).charset, setter: function (val) { if (options["encoding"] == val) return val; diff --git a/common/modules/main.jsm b/common/modules/main.jsm index d23cd02e..5c222325 100644 --- a/common/modules/main.jsm +++ b/common/modules/main.jsm @@ -296,9 +296,11 @@ overlay.overlayWindow(Object.keys(config.overlays), function _overlay(window) ({ }); }, - unload: function unload(window) { + cleanup: function cleanup(window) { overlay.windows = overlay.windows.filter(function (w) w != window); + }, + unload: function unload(window) { for each (let mod in this.modules.moduleList.reverse()) { mod.stale = true;