mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 15:48:00 +01:00
Fix async complete bug again. Why did I change it when it was working? It was late.
This commit is contained in:
@@ -384,6 +384,36 @@ function Options() //{{{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// firefox preferences which need to be changed to work well with vimperator
|
||||||
|
//
|
||||||
|
|
||||||
|
// work around firefox popup blocker
|
||||||
|
// TODO: Make this work like safeSetPref
|
||||||
|
var popupAllowedEvents = loadPreference("dom.popup_allowed_events", "change click dblclick mouseup reset submit");
|
||||||
|
if (!/keypress/.test(popupAllowedEvents))
|
||||||
|
{
|
||||||
|
storePreference("dom.popup_allowed_events", popupAllowedEvents + " keypress");
|
||||||
|
liberator.registerObserver("shutdown", function ()
|
||||||
|
{
|
||||||
|
if (loadPreference("dom.popup_allowed_events", "")
|
||||||
|
== popupAllowedEvents + " keypress")
|
||||||
|
storePreference("dom.popup_allowed_events", popupAllowedEvents);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// safeSetPref might try to echomsg. Need commandline.
|
||||||
|
liberator.registerObserver("load_commandline", function () {
|
||||||
|
// TODO: maybe reset in .destroy()?
|
||||||
|
// TODO: move to vim.js or buffer.js
|
||||||
|
// we have our own typeahead find implementation
|
||||||
|
options.safeSetPref("accessibility.typeaheadfind.autostart", false);
|
||||||
|
options.safeSetPref("accessibility.typeaheadfind", false); // actually the above setting should do it, but has no effect in firefox
|
||||||
|
});
|
||||||
|
|
||||||
|
// start with saved session
|
||||||
|
storePreference("browser.startup.page", 3);
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////}}}
|
/////////////////////////////////////////////////////////////////////////////}}}
|
||||||
////////////////////// COMMANDS ////////////////////////////////////////////////
|
////////////////////// COMMANDS ////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
@@ -772,7 +802,7 @@ function Options() //{{{
|
|||||||
.map(function (pref) [pref, ""])]);
|
.map(function (pref) [pref, ""])]);
|
||||||
});
|
});
|
||||||
|
|
||||||
let options = {
|
return {
|
||||||
|
|
||||||
OPTION_SCOPE_GLOBAL: 1,
|
OPTION_SCOPE_GLOBAL: 1,
|
||||||
OPTION_SCOPE_LOCAL: 2,
|
OPTION_SCOPE_LOCAL: 2,
|
||||||
@@ -980,38 +1010,6 @@ function Options() //{{{
|
|||||||
liberator.echoerr("E488: Trailing characters: " + name + "!");
|
liberator.echoerr("E488: Trailing characters: " + name + "!");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
|
||||||
// firefox preferences which need to be changed to work well with vimperator
|
|
||||||
//
|
|
||||||
|
|
||||||
// work around firefox popup blocker
|
|
||||||
// TODO: Make this work like safeSetPref
|
|
||||||
var popupAllowedEvents = loadPreference("dom.popup_allowed_events", "change click dblclick mouseup reset submit");
|
|
||||||
if (!/keypress/.test(popupAllowedEvents))
|
|
||||||
{
|
|
||||||
storePreference("dom.popup_allowed_events", popupAllowedEvents + " keypress");
|
|
||||||
liberator.registerObserver("shutdown", function ()
|
|
||||||
{
|
|
||||||
if (loadPreference("dom.popup_allowed_events", "")
|
|
||||||
== popupAllowedEvents + " keypress")
|
|
||||||
storePreference("dom.popup_allowed_events", popupAllowedEvents);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// safeSetPref might try to echomsg. Need commandline.
|
|
||||||
liberator.registerObserver("load_commandline", function () {
|
|
||||||
// TODO: maybe reset in .destroy()?
|
|
||||||
// TODO: move to vim.js or buffer.js
|
|
||||||
// we have our own typeahead find implementation
|
|
||||||
options.safeSetPref("accessibility.typeaheadfind.autostart", false);
|
|
||||||
options.safeSetPref("accessibility.typeaheadfind", false); // actually the above setting should do it, but has no effect in firefox
|
|
||||||
});
|
|
||||||
|
|
||||||
// start with saved session
|
|
||||||
storePreference("browser.startup.page", 3);
|
|
||||||
|
|
||||||
return options;
|
|
||||||
//}}}
|
//}}}
|
||||||
}; //}}}
|
}; //}}}
|
||||||
|
|
||||||
|
|||||||
@@ -251,8 +251,9 @@ function CommandLine() //{{{
|
|||||||
|
|
||||||
_reset: function _reset()
|
_reset: function _reset()
|
||||||
{
|
{
|
||||||
this.prefix = this.prefix + this.value.substr(0, this.start);
|
this.prefix = this.context.value.substring(0, this.start);
|
||||||
this.value = this.value.substr(this.start);
|
this.value = this.context.value.substring(this.start, this.caret);
|
||||||
|
this.suffix = this.context.value.substring(this.caret);
|
||||||
|
|
||||||
this.itemList.reset();
|
this.itemList.reset();
|
||||||
this.itemList.selectItem(this.selected);
|
this.itemList.selectItem(this.selected);
|
||||||
|
|||||||
Reference in New Issue
Block a user