1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-05 03:05:46 +01:00

Fix :echo undefined

This commit is contained in:
Kris Maglione
2008-12-11 15:22:01 -05:00
parent 016770bf7d
commit 0f330b3a15
4 changed files with 26 additions and 22 deletions

View File

@@ -811,7 +811,7 @@ function Events() //{{{
// This method pushes keys into the event queue from liberator // This method pushes keys into the event queue from liberator
// it is similar to vim's feedkeys() method, but cannot cope with // it is similar to vim's feedkeys() method, but cannot cope with
// 2 partially feeded strings, you have to feed one parsable string // 2 partially-fed strings, you have to feed one parsable string
// //
// @param keys: a string like "2<C-f>" to pass // @param keys: a string like "2<C-f>" to pass
// if you want < to be taken literally, prepend it with a \\ // if you want < to be taken literally, prepend it with a \\
@@ -829,6 +829,8 @@ function Events() //{{{
try try
{ {
liberator.threadYield(true, true);
noremap = !!noremap; noremap = !!noremap;
for (var i = 0; i < keys.length; i++) for (var i = 0; i < keys.length; i++)
@@ -1259,7 +1261,8 @@ function Events() //{{{
if (key == "<C-c>" && !event.isMacro) if (key == "<C-c>" && !event.isMacro)
{ {
events.feedingKeys = false; events.feedingKeys = false;
setTimeout(function () { liberator.echomsg("Canceled playback of macro '" + lastMacro + "'") }, 100); if (lastMacro)
setTimeout(function () { liberator.echomsg("Canceled playback of macro '" + lastMacro + "'") }, 100);
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
return true; return true;
@@ -1527,23 +1530,18 @@ function Events() //{{{
// TODO: move to buffer.js? // TODO: move to buffer.js?
progressListener: { progressListener: {
QueryInterface: function (aIID) QueryInterface: XPCOMUtils.generateQI([
{ Components.interfaces.nsIWebProgressListener,
if (aIID.equals(Components.interfaces.nsIWebProgressListener) || Components.interfaces.nsIXULBrowserWindow
aIID.equals(Components.interfaces.nsIXULBrowserWindow) || // for setOverLink(); ]),
aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
aIID.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;
},
// XXX: function may later be needed to detect a canceled synchronous openURL() // XXX: function may later be needed to detect a canceled synchronous openURL()
onStateChange: function (webProgress, request, flags, status) onStateChange: function (webProgress, request, flags, status)
{ {
const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
// STATE_IS_DOCUMENT | STATE_IS_WINDOW is important, because we also // STATE_IS_DOCUMENT | STATE_IS_WINDOW is important, because we also
// receive statechange events for loading images and other parts of the web page // receive statechange events for loading images and other parts of the web page
if (flags & (Components.interfaces.nsIWebProgressListener.STATE_IS_DOCUMENT | if (flags & (nsIWebProgressListener.STATE_IS_DOCUMENT | nsIWebProgressListener.STATE_IS_WINDOW))
Components.interfaces.nsIWebProgressListener.STATE_IS_WINDOW))
{ {
// This fires when the load event is initiated // This fires when the load event is initiated
// only thrown for the current tab, not when another tab changes // only thrown for the current tab, not when another tab changes
@@ -1624,11 +1622,13 @@ function Events() //{{{
} }
}, },
// stub functions for the interfaces // nsIXULBrowserWindow stubs
setJSStatus: function (status) { ; }, setJSDefaultStatus: function (status) {},
setJSDefaultStatus: function (status) { ; }, setJSStatus: function (status) {},
setDefaultStatus: function (status) { ; },
onLinkIconAvailable: function () { ; } // Stub for something else, presumably. Not in any documented
// interface.
onLinkIconAvailable: function () {}
}, },
// TODO: move to options.js? // TODO: move to options.js?

View File

@@ -59,11 +59,11 @@ the terms of any one of the MPL, the GPL or the LGPL.
<commandset id="onVimperatorFocus" <commandset id="onVimperatorFocus"
commandupdater="true" commandupdater="true"
events="focus" events="focus"
oncommandupdate="if (typeof liberator.modules.events != 'undefined') liberator.modules.events.onFocusChange(event);"/> oncommandupdate="if (liberator.modules.events != undefined) liberator.modules.events.onFocusChange(event);"/>
<commandset id="onVimperatorSelect" <commandset id="onVimperatorSelect"
commandupdater="true" commandupdater="true"
events="select" events="select"
oncommandupdate="if (typeof liberator.modules.events != 'undefined') liberator.modules.events.onSelectionChange(event);"/> oncommandupdate="if (liberator.modules.events != undefined) liberator.modules.events.onSelectionChange(event);"/>
<!-- As of Firefox 3.1pre, <iframe>.height changes do not seem to have immediate effect, <!-- As of Firefox 3.1pre, <iframe>.height changes do not seem to have immediate effect,
therefore we need to put them into a <vbox> for which that works just fine --> therefore we need to put them into a <vbox> for which that works just fine -->

View File

@@ -663,14 +663,16 @@ function Tabs() //{{{
return store.options; return store.options;
}, },
get localStore() getLocalStore: function (tab)
{ {
let tab = this.getTab(); let tab = this.getTab(tab);
if (!tab.liberatorStore) if (!tab.liberatorStore)
tab.liberatorStore = {}; tab.liberatorStore = {};
return tab.liberatorStore; return tab.liberatorStore;
}, },
get localStore() this.getLocalStore(),
get tabStrip() get tabStrip()
{ {
if (config.hostApplication == "Firefox") if (config.hostApplication == "Firefox")

View File

@@ -631,6 +631,8 @@ function CommandLine() //{{{
arg = util.objectToString(arg, useColor); arg = util.objectToString(arg, useColor);
else if (typeof arg == "string" && /\n/.test(arg)) else if (typeof arg == "string" && /\n/.test(arg))
arg = <span highlight="CmdOutput">{arg}</span>; arg = <span highlight="CmdOutput">{arg}</span>;
else
arg = String(arg);
return arg; return arg;
} }