mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 11:47:58 +01:00
fixed textarea/location bar keys properly (location bar still not working, when completion popup is open)
This commit is contained in:
@@ -25,19 +25,16 @@ function Editor() //{{{
|
|||||||
|
|
||||||
function editor()
|
function editor()
|
||||||
{
|
{
|
||||||
var editor = window.document.commandDispatcher.focusedElement;
|
return window.document.commandDispatcher.focusedElement;
|
||||||
if (editor && editor.mInputField)
|
|
||||||
editor = editor.mInputField;
|
|
||||||
return editor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getController()
|
function getController()
|
||||||
{
|
{
|
||||||
var editor = editor();
|
var ed = editor();
|
||||||
if (!editor || !editor.controllers)
|
if (!ed || !ed.controllers)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return editor.controllers.getControllerAt(0);
|
return ed.controllers.getControllerForCommand("cmd_beginLine");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.line = function()
|
this.line = function()
|
||||||
@@ -99,11 +96,7 @@ function Editor() //{{{
|
|||||||
this.executeCommand = function(cmd, count)
|
this.executeCommand = function(cmd, count)
|
||||||
{
|
{
|
||||||
var controller = getController();
|
var controller = getController();
|
||||||
var el = window.document.commandDispatcher.focusedElement;
|
if (!controller || !controller.supportsCommand(cmd) || !controller.isCommandEnabled(cmd))
|
||||||
if (!controller || !el)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!controller.supportsCommand(cmd) || !controller.isCommandEnabled(cmd))
|
|
||||||
{
|
{
|
||||||
vimperator.beep();
|
vimperator.beep();
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user