diff --git a/botanjs/src/Components/Vim/Actions/DELETE.js b/botanjs/src/Components/Vim/Actions/DELETE.js index a5a7f6c..1f58fae 100644 --- a/botanjs/src/Components/Vim/Actions/DELETE.js +++ b/botanjs/src/Components/Vim/Actions/DELETE.js @@ -153,6 +153,9 @@ e = sp; } + // For removing the very last line + if( c[ sp ] == undefined ) s --; + var removed = c.substring( s, e + 1 ); reg.change( removed, newLine ); diff --git a/botanjs/src/Components/Vim/VimArea.js b/botanjs/src/Components/Vim/VimArea.js index a1b57f5..30228b5 100644 --- a/botanjs/src/Components/Vim/VimArea.js +++ b/botanjs/src/Components/Vim/VimArea.js @@ -87,11 +87,11 @@ if( detectScreenSize ) { var val = element.value; - this.__testScreen(function() { _self.VisualizeVimFrame( val ); }); + this.__testScreen(function() { _self.__visualize( val ); }); } else { - this.VisualizeVimFrame( element.value ); + this.__visualize( element.value ); } // Set buffer index @@ -177,7 +177,8 @@ } }; - VimArea.prototype.VisualizeVimFrame = function( content ) + // Visualize the Vim Frame + VimArea.prototype.__visualize = function( content ) { var _self = this; this.content = content; @@ -263,6 +264,7 @@ ); this.stage.addEventListeners( this.__stagedEvents ); + this.dispatchEvent( new BotanEvent( "Visualized" ) ); }; VimArea.prototype.demo = function( seq )