mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 00:17:57 +01:00
merge minor fixes to Commandline echo/echoerr/clear
This commit is contained in:
@@ -273,7 +273,7 @@ function CommandLine() //{{{
|
|||||||
this.echo = function(str, flags)
|
this.echo = function(str, flags)
|
||||||
{
|
{
|
||||||
var focused = document.commandDispatcher.focusedElement;
|
var focused = document.commandDispatcher.focusedElement;
|
||||||
if (/*!echo_allowed && focused && */focused == command_widget.inputField)
|
if (focused && focused == command_widget.inputField || focused == multiline_input_widget.inputField)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (typeof str != "string")
|
if (typeof str != "string")
|
||||||
@@ -296,7 +296,7 @@ function CommandLine() //{{{
|
|||||||
this.echoErr = function(str)
|
this.echoErr = function(str)
|
||||||
{
|
{
|
||||||
var focused = document.commandDispatcher.focusedElement;
|
var focused = document.commandDispatcher.focusedElement;
|
||||||
if (/*!echo_allowed && focused && */focused == command_widget.inputField)
|
if (focused && focused == command_widget.inputField || focused == multiline_input_widget.inputField)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
setErrorStyle();
|
setErrorStyle();
|
||||||
@@ -343,6 +343,7 @@ function CommandLine() //{{{
|
|||||||
{
|
{
|
||||||
multiline_input_widget.collapsed = true;
|
multiline_input_widget.collapsed = true;
|
||||||
multiline_output_widget.collapsed = true;
|
multiline_output_widget.collapsed = true;
|
||||||
|
completionlist.hide();
|
||||||
|
|
||||||
setPrompt(" "); // looks faster than an empty string as most prompts are 1 char long
|
setPrompt(" "); // looks faster than an empty string as most prompts are 1 char long
|
||||||
setCommand("");
|
setCommand("");
|
||||||
@@ -374,6 +375,9 @@ function CommandLine() //{{{
|
|||||||
}
|
}
|
||||||
else if (event.type == "keypress")
|
else if (event.type == "keypress")
|
||||||
{
|
{
|
||||||
|
if (!cur_extended_mode)
|
||||||
|
return;
|
||||||
|
|
||||||
var key = vimperator.events.toString(event);
|
var key = vimperator.events.toString(event);
|
||||||
|
|
||||||
// user pressed ENTER to carry out a command
|
// user pressed ENTER to carry out a command
|
||||||
@@ -600,7 +604,6 @@ function CommandLine() //{{{
|
|||||||
var key = vimperator.events.toString(event);
|
var key = vimperator.events.toString(event);
|
||||||
if (vimperator.events.isAcceptKey(key))
|
if (vimperator.events.isAcceptKey(key))
|
||||||
{
|
{
|
||||||
//var lines = multiline_input_widget.value.substr(0, multiline_input_widget.selectionStart).split(/\n/);
|
|
||||||
var text = multiline_input_widget.value.substr(0, multiline_input_widget.selectionStart);
|
var text = multiline_input_widget.value.substr(0, multiline_input_widget.selectionStart);
|
||||||
if (text.match(multiline_regexp))
|
if (text.match(multiline_regexp))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user