mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-24 08:12:29 +01:00
fixed MOW message stacking and some small speed improvements
This commit is contained in:
@@ -508,14 +508,16 @@ vimperator.Events = function() //{{{
|
||||
break;
|
||||
|
||||
case vimperator.modes.CARET:
|
||||
// setting this option will trigger an observer which will care about all other details
|
||||
// like setting the NORMAL mode
|
||||
// setting this option will trigger an observer which will
|
||||
// care about all other details like setting the NORMAL mode
|
||||
vimperator.options.setFirefoxPref("accessibility.browsewithcaret", false);
|
||||
break;
|
||||
|
||||
case vimperator.modes.INSERT:
|
||||
if ((vimperator.modes.extended & vimperator.modes.TEXTAREA) && !vimperator.options["insertmode"])
|
||||
{
|
||||
vimperator.mode = vimperator.modes.TEXTAREA;
|
||||
}
|
||||
else
|
||||
{
|
||||
vimperator.modes.reset();
|
||||
@@ -527,9 +529,11 @@ vimperator.Events = function() //{{{
|
||||
default:
|
||||
// clear any selection made
|
||||
var selection = window.content.getSelection();
|
||||
try { // a simple if (selection) does not work
|
||||
try
|
||||
{ // a simple if (selection) does not seem to work
|
||||
selection.collapseToStart();
|
||||
} catch (e) { }
|
||||
}
|
||||
catch (e) { }
|
||||
vimperator.commandline.clear();
|
||||
|
||||
vimperator.modes.reset();
|
||||
|
||||
@@ -164,12 +164,13 @@ vimperator.modes = (function()
|
||||
},
|
||||
|
||||
// helper function to set both modes in one go
|
||||
// if silent == true, you also need to take care of the mode handling changes yourself
|
||||
set: function(main_mode, extended_mode, silent)
|
||||
{
|
||||
// if a main mode is set, the extended is always cleared
|
||||
if (typeof main_mode === "number")
|
||||
{
|
||||
if (main_mode != main)
|
||||
if (!silent && main_mode != main)
|
||||
handleModeChange(main, main_mode);
|
||||
|
||||
main = main_mode;
|
||||
|
||||
@@ -288,6 +288,15 @@ vimperator.CommandLine = function() //{{{
|
||||
this.clear();
|
||||
}
|
||||
|
||||
this.clear = function()
|
||||
{
|
||||
multiline_input_widget.collapsed = true;
|
||||
multiline_output_widget.collapsed = true;
|
||||
completionlist.hide();
|
||||
|
||||
setLine("", this.HL_NORMAL);
|
||||
};
|
||||
|
||||
// TODO: add :messages entry
|
||||
// vimperator.echo uses different order of flags as it omits the hightlight group, change v.commandline.echo argument order? --mst
|
||||
this.echo = function(str, highlight_group, flags)
|
||||
@@ -354,15 +363,6 @@ vimperator.CommandLine = function() //{{{
|
||||
}, 10);
|
||||
};
|
||||
|
||||
this.clear = function()
|
||||
{
|
||||
multiline_input_widget.collapsed = true;
|
||||
multiline_output_widget.collapsed = true;
|
||||
completionlist.hide();
|
||||
|
||||
setLine("", this.HL_NORMAL);
|
||||
};
|
||||
|
||||
this.onEvent = function(event)
|
||||
{
|
||||
var command = this.getCommand();
|
||||
@@ -401,6 +401,7 @@ vimperator.CommandLine = function() //{{{
|
||||
history.add(command);
|
||||
vimperator.modes.reset(true); //FIXME: use mode stack
|
||||
completionlist.hide();
|
||||
vimperator.focusContent(false);
|
||||
vimperator.statusline.updateProgress(""); // we may have a "match x of y" visible
|
||||
return vimperator.triggerCallback("submit", mode, command);
|
||||
}
|
||||
@@ -650,6 +651,9 @@ vimperator.CommandLine = function() //{{{
|
||||
|
||||
switch (key)
|
||||
{
|
||||
case "<Esc>":
|
||||
return; // handled globally in events.js:onEscape()
|
||||
|
||||
case ":":
|
||||
vimperator.commandline.open(":", "", vimperator.modes.EX);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user