forked from Botanical/BotanJS
Added Support for S
This commit is contained in:
parent
1511c70957
commit
282ecffce2
@ -82,6 +82,9 @@
|
||||
case "marks":
|
||||
out[ CMD_TYPE ] = "MARKS";
|
||||
break;
|
||||
case "mark":
|
||||
out[ CMD_TYPE ] = "MARK";
|
||||
break;
|
||||
case "ver":
|
||||
case "version":
|
||||
out[ CMD_TYPE ] = "VERSION";
|
||||
@ -156,7 +159,7 @@
|
||||
try
|
||||
{
|
||||
this.__cursor.openRunAction(
|
||||
cmd[ CMD_TYPE ], e, cmd[ CMD_ARGS ], cmd[ CMD_RANGE ]
|
||||
cmd[ CMD_TYPE ], e, false, cmd[ CMD_ARGS ], cmd[ CMD_RANGE ]
|
||||
);
|
||||
this.__msg = this.__cursor.message;
|
||||
}
|
||||
|
@ -48,6 +48,8 @@
|
||||
msg += "\nmark line col file/text";
|
||||
|
||||
var feeder = this.__cursor.feeder;
|
||||
var chopLen = feeder.firstBuffer.cols + 1;
|
||||
|
||||
for( var i = 0, j = Keys[ i ]; j != undefined; i ++, j = Keys[ i ] )
|
||||
{
|
||||
var r = marks.get( j );
|
||||
@ -63,7 +65,7 @@
|
||||
var ll = 3 - col.length;
|
||||
for( var il = 0; il < ll; il ++ ) col = " " + col;
|
||||
|
||||
msg += "\n " + j + " " + line + " " + col + " " + t;
|
||||
msg += ( "\n " + j + " " + line + " " + col + " " + t ).substring( 0, chopLen );
|
||||
}
|
||||
|
||||
var lastLine = Mesg( "WAIT_FOR_INPUT" );
|
||||
|
@ -48,11 +48,17 @@
|
||||
return i;
|
||||
};
|
||||
|
||||
/** marker @type {Components.Vim.State.Marks} */
|
||||
var MarkSelected = function( marker, PStart, PEnd )
|
||||
{
|
||||
};
|
||||
|
||||
/** @type {Components.Vim.IAction} */
|
||||
var VISUAL = function( Cursor )
|
||||
{
|
||||
this.__reset( Cursor );
|
||||
this.__msg = "";
|
||||
|
||||
Cursor.blink = false;
|
||||
Cursor.pSpace = true;
|
||||
};
|
||||
|
@ -287,7 +287,7 @@
|
||||
case S: // Delete Char and start insert
|
||||
if( ccur.getLine().content != "" )
|
||||
{
|
||||
ccur.openRunAction( "DELETE", e, ccur.aPos );
|
||||
ccur.openRunAction( "DELETE", e, false, ccur.aPos );
|
||||
}
|
||||
ccur.openAction( "INSERT", e );
|
||||
break;
|
||||
@ -315,9 +315,16 @@
|
||||
case C: // Then insert
|
||||
ccur.openAction( "DELETE", e );
|
||||
break;
|
||||
case SHIFT + S: // Synonym to cc
|
||||
var c = new ActionEvent( this.__vimArea, "c" );
|
||||
ccur.openRunAction( "DELETE", c, c );
|
||||
break;
|
||||
case Y: // Yank with motion
|
||||
ccur.openAction( "YANK", e );
|
||||
break;
|
||||
case M: // Mark
|
||||
ccur.openAction( "MARK", e );
|
||||
break;
|
||||
|
||||
case P: // Put
|
||||
ccur.suppressEvent();
|
||||
@ -335,7 +342,7 @@
|
||||
beep();
|
||||
break;
|
||||
}
|
||||
ccur.openRunAction( "DELETE", e, ccur.aPos );
|
||||
ccur.openRunAction( "DELETE", e, false, ccur.aPos );
|
||||
break;
|
||||
case SHIFT + U: // Undo previous changes in oneline
|
||||
break;
|
||||
@ -611,26 +618,13 @@
|
||||
|
||||
break;
|
||||
|
||||
case M:
|
||||
this.__captureComp = true;
|
||||
|
||||
var marks = this.__vimArea.marks;
|
||||
this.__composite( e, function( e2 ) {
|
||||
var line = ccur.getLine().lineNum;
|
||||
if( !marks.set( e2.key, line, ccur.aX ) )
|
||||
{
|
||||
beep();
|
||||
}
|
||||
}, ANY_KEY );
|
||||
break;
|
||||
|
||||
case SHIFT + T: // To
|
||||
case T: // To
|
||||
this.__captureComp = true;
|
||||
|
||||
this.__composite( e, function( e2 ) {
|
||||
var oX = ccur.X;
|
||||
ccur.openRunAction( "TO", e, e2 );
|
||||
ccur.openRunAction( "TO", e, false, e2 );
|
||||
|
||||
if( ccur.X < oX )
|
||||
{
|
||||
@ -648,7 +642,7 @@
|
||||
this.__captureComp = true;
|
||||
|
||||
this.__composite( e, function( e2 ) {
|
||||
ccur.openRunAction( "TO", e, e2 );
|
||||
ccur.openRunAction( "TO", e, false, e2 );
|
||||
}, ANY_KEY );
|
||||
|
||||
break;
|
||||
|
@ -566,11 +566,11 @@
|
||||
};
|
||||
|
||||
// Open, Run, then close an action
|
||||
Cursor.prototype.openRunAction = function( name, e, arg1, arg2, arg3, arg4, arg5 )
|
||||
Cursor.prototype.openRunAction = function( name, e, eO, arg1, arg2, arg3, arg4, arg5 )
|
||||
{
|
||||
debug.Info( "OpenRunAction: " + name );
|
||||
/** @type {Components.Vim.IAction} */
|
||||
var action = new (Actions[ name ])( this );
|
||||
var action = new (Actions[ name ])( this, eO );
|
||||
action.handler( e, arg1, arg2, arg3, arg4, arg5 );
|
||||
this.__pulseMsg = action.getMessage();
|
||||
action.dispose();
|
||||
|
@ -224,7 +224,7 @@
|
||||
var cur = this.__cursor;
|
||||
|
||||
cur.suppressEvent();
|
||||
this.__cursor.openRunAction( action, e, this.__command.slice() );
|
||||
this.__cursor.openRunAction( action, e, false, this.__command.slice() );
|
||||
cur.unsuppressEvent();
|
||||
};
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
/** @type {System.Debug} */
|
||||
var debug = __import( "System.Debug" );
|
||||
|
||||
var beep = __import( "Components.Vim.Beep" );
|
||||
|
||||
var Keys = "'ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxy\"[]^.<>";
|
||||
|
||||
var Marks = function()
|
||||
@ -13,7 +15,11 @@
|
||||
|
||||
Marks.prototype.set = function( t, line, col )
|
||||
{
|
||||
if( Keys.indexOf( t ) == -1 ) return false;
|
||||
if( Keys.indexOf( t ) == -1 )
|
||||
{
|
||||
beep();
|
||||
return false;
|
||||
}
|
||||
|
||||
this.__marks[ t ] = [ line, col ];
|
||||
return true;
|
||||
|
@ -323,7 +323,7 @@
|
||||
statusBar.stamp( 1, false );
|
||||
controls.handler( _self, new ActionEvent( _self, "Escape" ) );
|
||||
setTimeout( function() {
|
||||
cursor.openRunAction( "VA_REC", undefined, true );
|
||||
cursor.openRunAction( "VA_REC", false, false, true );
|
||||
_self.__demoActive = false;
|
||||
_self.stage.addEventListeners( _self.__stagedEvents );
|
||||
}, 100 );
|
||||
|
Loading…
Reference in New Issue
Block a user