mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 02:27:58 +01:00
quick'n dirty block cursor, VERY BUGGY, stay in insert mode of textareas for now
This commit is contained in:
@@ -19,6 +19,11 @@
|
||||
|
||||
function Editor() //{{{
|
||||
{
|
||||
function editor()
|
||||
{
|
||||
return window.document.commandDispatcher.focusedElement;
|
||||
}
|
||||
|
||||
function getController()
|
||||
{
|
||||
var el = window.document.commandDispatcher.focusedElement;
|
||||
@@ -81,6 +86,9 @@ function Editor() //{{{
|
||||
{
|
||||
controller.doCommand(cmd);
|
||||
did_command = true;
|
||||
|
||||
if (vimperator.hasMode(vimperator.modes.TEXTAREA))
|
||||
this.moveCaret();
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
@@ -92,6 +100,15 @@ function Editor() //{{{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// very rudimentary testing code
|
||||
this.moveCaret = function(pos)
|
||||
{
|
||||
if (!pos)
|
||||
pos = editor().selectionStart - 1;
|
||||
|
||||
editor().setSelectionRange(pos, pos+1);
|
||||
}
|
||||
|
||||
// cmd = y, d, c
|
||||
// motion = b, 0, gg, G, etc.
|
||||
|
||||
Reference in New Issue
Block a user