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