forked from Botanical/BotanJS
Remove useless imports
This commit is contained in:
parent
52e4733fcc
commit
ee26a7dcc8
@ -1,17 +1,8 @@
|
||||
(function(){
|
||||
var ns = __namespace( "Components.Vim.Actions" );
|
||||
|
||||
/** @type {Dandelion} */
|
||||
var Dand = __import( "Dandelion" );
|
||||
/** @type {Dandelion.IDOMElement} */
|
||||
var IDOMElement = __import( "Dandelion.IDOMElement" );
|
||||
/** @type {Dandelion.IDOMObject} */
|
||||
var IDOMObject = __import( "Dandelion.IDOMObject" );
|
||||
/** @type {System.Cycle} */
|
||||
var Cycle = __import( "System.Cycle" );
|
||||
/** @type {System.Debug} */
|
||||
var debug = __import( "System.Debug" );
|
||||
|
||||
var debug = __import( "System.Debug" );
|
||||
var Mesg = __import( "Components.Vim.Message" );
|
||||
|
||||
/** @type {Components.Vim.Cursor.IAction} */
|
||||
@ -25,6 +16,14 @@
|
||||
{
|
||||
};
|
||||
|
||||
INSERT.prototype.handler = function( e )
|
||||
{
|
||||
e.preventDefault();
|
||||
if( e.key.length == "1" )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
INSERT.prototype.getMessage = function()
|
||||
{
|
||||
var l = this.cursor.feeder.firstBuffer.cols;
|
||||
|
91
botanjs/src/Components/Vim/Controls.js
Normal file
91
botanjs/src/Components/Vim/Controls.js
Normal file
@ -0,0 +1,91 @@
|
||||
(function(){
|
||||
var ns = __namespace( "Components.Vim" );
|
||||
|
||||
var debug = __import( "System.Debug" );
|
||||
|
||||
var Controls = function( sender, e )
|
||||
{
|
||||
// Action Mode handled by the actions themselves
|
||||
var cfeeder = sender.contentFeeder;
|
||||
if( cfeeder.cursor.action )
|
||||
{
|
||||
cfeeder.cursor.action.handler( e );
|
||||
return;
|
||||
}
|
||||
|
||||
if( e.altKey
|
||||
// F2 - F12
|
||||
|| ( 112 < e.keyCode && e.keyCode < 124 )
|
||||
) return;
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
if( e.ctrlKey )
|
||||
{
|
||||
VimComboFunc( sender, e );
|
||||
return;
|
||||
}
|
||||
|
||||
var kCode = e.keyCode + ( e.shiftKey ? 1000 : 0 );
|
||||
|
||||
var cfeeder = sender.contentFeeder;
|
||||
var sfeeder = sender.statusFeeder;
|
||||
switch( kCode )
|
||||
{
|
||||
// Cursor movements
|
||||
case 8: // Backspace, go back 1 char, regardless of line
|
||||
break;
|
||||
case 72: // h
|
||||
cfeeder.cursor.moveX( -1 );
|
||||
break;
|
||||
case 74: // j
|
||||
cfeeder.cursor.moveY( 1 );
|
||||
break;
|
||||
case 75: // k
|
||||
cfeeder.cursor.moveY( -1 );
|
||||
break;
|
||||
case 76: // l
|
||||
cfeeder.cursor.moveX( 1 );
|
||||
break;
|
||||
|
||||
// Insert
|
||||
case 65: // a
|
||||
cfeeder.cursor.openInsert();
|
||||
break;
|
||||
|
||||
case 1065: // A, append at the line end
|
||||
break;
|
||||
case 73: // i
|
||||
break;
|
||||
case 1073: // I, append before the line start, after spaces
|
||||
break;
|
||||
|
||||
// remove characters
|
||||
case 88: // x, remove in cursor
|
||||
break;
|
||||
case 1088: // X, remove before cursor
|
||||
break;
|
||||
|
||||
case 1072: // H, First line buffer
|
||||
break;
|
||||
case 1076: // L, Last line buffer
|
||||
break;
|
||||
case 1052: // $
|
||||
cfeeder.cursor.lineEnd();
|
||||
break;
|
||||
case 1053: // %
|
||||
break;
|
||||
case 1054: // ^
|
||||
cfeeder.cursor.lineStart();
|
||||
break;
|
||||
case 1074: // J, Join lines
|
||||
break;
|
||||
case 1075: // K, manual entry
|
||||
break;
|
||||
case 112: // F1, help
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
ns[ NS_EXPORT ]( EX_FUNC, "Controls", Controls );
|
||||
})();
|
@ -1,16 +1,8 @@
|
||||
(function(){
|
||||
var ns = __namespace( "Components.Vim" );
|
||||
|
||||
/** @type {Dandelion} */
|
||||
var Dand = __import( "Dandelion" );
|
||||
/** @type {Dandelion.IDOMElement} */
|
||||
var IDOMElement = __import( "Dandelion.IDOMElement" );
|
||||
/** @type {Dandelion.IDOMObject} */
|
||||
var IDOMObject = __import( "Dandelion.IDOMObject" );
|
||||
/** @type {System.Cycle} */
|
||||
var Cycle = __import( "System.Cycle" );
|
||||
/** @type {System.Debug} */
|
||||
var debug = __import( "System.Debug" );
|
||||
var debug = __import( "System.Debug" );
|
||||
|
||||
var Actions = __import( "Components.Vim.Actions.*" );
|
||||
|
||||
@ -219,7 +211,7 @@
|
||||
{
|
||||
var feeder = this.feeder;
|
||||
if( this.action ) this.action.dispose();
|
||||
this.action = new Actions[ "INSERT" ];
|
||||
this.action = new (Actions[ "INSERT" ])( this );
|
||||
|
||||
feeder.dispatcher.dispatchEvent( new BotanEvent( "VisualUpdate" ) );
|
||||
};
|
||||
|
@ -1,16 +1,7 @@
|
||||
(function(){
|
||||
var ns = __namespace( "Components.Vim" );
|
||||
|
||||
/** @type {Dandelion} */
|
||||
var Dand = __import( "Dandelion" );
|
||||
/** @type {Dandelion.IDOMElement} */
|
||||
var IDOMElement = __import( "Dandelion.IDOMElement" );
|
||||
/** @type {Dandelion.IDOMObject} */
|
||||
var IDOMObject = __import( "Dandelion.IDOMObject" );
|
||||
/** @type {System.Cycle} */
|
||||
var Cycle = __import( "System.Cycle" );
|
||||
/** @type {System.Debug} */
|
||||
var debug = __import( "System.Debug" );
|
||||
var debug = __import( "System.Debug" );
|
||||
|
||||
var LineBuffer = function( cols, nextLineBuffer )
|
||||
{
|
||||
|
@ -1,16 +1,8 @@
|
||||
(function(){
|
||||
var ns = __namespace( "Components.Vim" );
|
||||
|
||||
/** @type {Dandelion} */
|
||||
var Dand = __import( "Dandelion" );
|
||||
/** @type {Dandelion.IDOMElement} */
|
||||
var IDOMElement = __import( "Dandelion.IDOMElement" );
|
||||
/** @type {Dandelion.IDOMObject} */
|
||||
var IDOMObject = __import( "Dandelion.IDOMObject" );
|
||||
/** @type {System.Cycle} */
|
||||
var Cycle = __import( "System.Cycle" );
|
||||
/** @type {System.Debug} */
|
||||
var debug = __import( "System.Debug" );
|
||||
var debug = __import( "System.Debug" );
|
||||
|
||||
/** @type {Components.Vim.LineBuffer} */
|
||||
var LineBuffer = ns[ NS_INVOKE ]( "LineBuffer" );
|
||||
|
@ -1,16 +1,7 @@
|
||||
(function(){
|
||||
var ns = __namespace( "Components.Vim" );
|
||||
|
||||
/** @type {Dandelion} */
|
||||
var Dand = __import( "Dandelion" );
|
||||
/** @type {Dandelion.IDOMElement} */
|
||||
var IDOMElement = __import( "Dandelion.IDOMElement" );
|
||||
/** @type {Dandelion.IDOMObject} */
|
||||
var IDOMObject = __import( "Dandelion.IDOMObject" );
|
||||
/** @type {System.Cycle} */
|
||||
var Cycle = __import( "System.Cycle" );
|
||||
/** @type {System.Debug} */
|
||||
var debug = __import( "System.Debug" );
|
||||
var debug = __import( "System.Debug" );
|
||||
|
||||
/** @type {Components.VimArea.LineFeeder} */
|
||||
var LineFeeder = ns[ NS_INVOKE ]( "LineFeeder" );
|
||||
|
@ -1,12 +1,8 @@
|
||||
(function(){
|
||||
var ns = __namespace( "Components.Vim" );
|
||||
|
||||
/** @type {Dandelion} */
|
||||
var Dand = __import( "Dandelion" );
|
||||
/** @type {Dandelion.IDOMElement} */
|
||||
var IDOMElement = __import( "Dandelion.IDOMElement" );
|
||||
/** @type {Dandelion.IDOMObject} */
|
||||
var IDOMObject = __import( "Dandelion.IDOMObject" );
|
||||
/** @type {System.utils.DataKey} */
|
||||
var DataKey = __import( "System.utils.DataKey" );
|
||||
/** @type {System.Cycle} */
|
||||
@ -19,6 +15,7 @@
|
||||
/** @type {Components.Vim.StatusBar} */
|
||||
var StatusBar = ns[ NS_INVOKE ]( "StatusBar" );
|
||||
|
||||
var VimControls = ns[ NS_INVOKE ]( "Controls" );
|
||||
var mesg = ns[ NS_INVOKE ]( "Message" );
|
||||
|
||||
var KeyHandler = function( sender, handler )
|
||||
@ -33,81 +30,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
var VimControls = function( sender, e )
|
||||
{
|
||||
if( e.altKey
|
||||
// F2 - F12
|
||||
|| ( 112 < e.keyCode && e.keyCode < 124 )
|
||||
) return;
|
||||
|
||||
e.preventDefault();
|
||||
if( e.ctrlKey )
|
||||
{
|
||||
VimComboFunc( sender, e );
|
||||
return;
|
||||
}
|
||||
|
||||
var kCode = e.keyCode + ( e.shiftKey ? 1000 : 0 );
|
||||
|
||||
var cfeeder = sender.contentFeeder;
|
||||
var sfeeder = sender.statusFeeder;
|
||||
switch( kCode )
|
||||
{
|
||||
// Cursor movements
|
||||
case 8: // Backspace, go back 1 char, regardless of line
|
||||
break;
|
||||
case 72: // h
|
||||
cfeeder.cursor.moveX( -1 );
|
||||
break;
|
||||
case 74: // j
|
||||
cfeeder.cursor.moveY( 1 );
|
||||
break;
|
||||
case 75: // k
|
||||
cfeeder.cursor.moveY( -1 );
|
||||
break;
|
||||
case 76: // l
|
||||
cfeeder.cursor.moveX( 1 );
|
||||
break;
|
||||
|
||||
// Insert
|
||||
case 65: // a
|
||||
cfeeder.cursor.openInsert();
|
||||
break;
|
||||
|
||||
case 1065: // A, append at the line end
|
||||
break;
|
||||
case 73: // i
|
||||
break;
|
||||
case 1073: // I, append before the line start, after spaces
|
||||
break;
|
||||
|
||||
// remove characters
|
||||
case 88: // x, remove in cursor
|
||||
break;
|
||||
case 1088: // X, remove before cursor
|
||||
break;
|
||||
|
||||
case 1072: // H, First line buffer
|
||||
break;
|
||||
case 1076: // L, Last line buffer
|
||||
break;
|
||||
case 1052: // $
|
||||
cfeeder.cursor.lineEnd();
|
||||
break;
|
||||
case 1053: // %
|
||||
break;
|
||||
case 1054: // ^
|
||||
cfeeder.cursor.lineStart();
|
||||
break;
|
||||
case 1074: // J, Join lines
|
||||
break;
|
||||
case 1075: // K, manual entry
|
||||
break;
|
||||
case 112: // F1, help
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/* stage @param {Dandelion.IDOMElement} */
|
||||
var VimArea = function( stage )
|
||||
{
|
||||
|
@ -1,17 +1,6 @@
|
||||
(function(){
|
||||
var ns = __namespace( "Components.Vim" );
|
||||
|
||||
/** @type {Dandelion} */
|
||||
var Dand = __import( "Dandelion" );
|
||||
/** @type {Dandelion.IDOMElement} */
|
||||
var IDOMElement = __import( "Dandelion.IDOMElement" );
|
||||
/** @type {Dandelion.IDOMObject} */
|
||||
var IDOMObject = __import( "Dandelion.IDOMObject" );
|
||||
/** @type {System.Cycle} */
|
||||
var Cycle = __import( "System.Cycle" );
|
||||
/** @type {System.Debug} */
|
||||
var debug = __import( "System.Debug" );
|
||||
|
||||
var messages = {
|
||||
"INSERT": "-- INSERT --"
|
||||
, "REPLACE": "-- REPLACE --"
|
||||
|
Loading…
Reference in New Issue
Block a user