can now q!

This commit is contained in:
斟酌 鵬兄 2017-03-02 18:26:14 +08:00
parent e81fe5cc37
commit 6c39f480bf
4 changed files with 12 additions and 4 deletions

View File

@ -35,7 +35,14 @@
var cur = this.__cursor; var cur = this.__cursor;
var Vim = cur.Vim; var Vim = cur.Vim;
if( cur.rec.changed ) var forceQuit = p.join( "" ).trim();
if( forceQuit && forceQuit[0] == "!" && 1 < forceQuit.length )
{
this.__msg = VimError( "E488" );
return false;
}
if( !forceQuit && cur.rec.changed )
{ {
var msg = VimError( "E37" ); var msg = VimError( "E37" );

View File

@ -13,11 +13,12 @@
var LineOffset = function( buffs, l ) var LineOffset = function( buffs, l )
{ {
/** @type {Components.Vim.LineBuffer} */
var offset = 0; var offset = 0;
LineLoop: LineLoop:
for( var i = 0, line = buffs[0]; for( var i = 0,
/** @type {Components.Vim.LineBuffer} */
line = buffs[0];
line && i < l; i ++ ) line && i < l; i ++ )
{ {
while( line ) while( line )

View File

@ -83,7 +83,6 @@
, new EventKey( "Blur", function() { _self.__active = false; } ) , new EventKey( "Blur", function() { _self.__active = false; } )
]; ];
if( detectScreenSize ) if( detectScreenSize )
{ {
var val = element.value; var val = element.value;

View File

@ -43,6 +43,7 @@ var VIMRE_VERSION = "1.0.1";
, "E481": "No range allowed" , "E481": "No range allowed"
, "E492": "Not an editor command: %1" , "E492": "Not an editor command: %1"
, "E486": "Pattern not found: %1" , "E486": "Pattern not found: %1"
, "E488": "Trailing characters"
// EXtended Errors // EXtended Errors
, "EX1": "Pattern Error( %1 )" , "EX1": "Pattern Error( %1 )"