2016-03-12 19:30:33 +00:00
|
|
|
(function(){
|
|
|
|
var ns = __namespace( "Components.Vim" );
|
|
|
|
|
|
|
|
var messages = {
|
|
|
|
"INSERT": "-- INSERT --"
|
2016-03-13 00:35:29 +00:00
|
|
|
, "REPLACE": "-- REPLACE --"
|
2016-03-12 19:30:33 +00:00
|
|
|
, "MORE": "-- MORE --"
|
2016-03-13 12:26:26 +00:00
|
|
|
, "VISLINE": "-- VISUAL LINE --"
|
2016-03-12 19:30:33 +00:00
|
|
|
, "WRITE": "\"%1\" %2L, %3C written"
|
|
|
|
, "CONTINUE": "Press ENTER or type command to continue"
|
|
|
|
, "SEARCH_HIT_BOTTOM": "Seach hit BOTTOM, contining at TOP"
|
|
|
|
, "TOP": "Top"
|
|
|
|
, "BOTTOM": "Bot"
|
|
|
|
, "ALL": "All"
|
|
|
|
, "EXIT": "Type :quit<Enter> to exit Vim"
|
2016-03-16 10:55:18 +00:00
|
|
|
|
|
|
|
, "UNDO_LIMIT": "Already at oldest change"
|
2016-03-16 20:57:43 +00:00
|
|
|
, "REDO_LIMIT": "Already at newest change"
|
2016-03-12 19:30:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
var errors = {
|
|
|
|
"E486": "E486: Pattern not found: %1"
|
|
|
|
};
|
|
|
|
|
2016-03-13 18:15:24 +00:00
|
|
|
var GetString = function( arr, key, restArgs )
|
2016-03-12 19:30:33 +00:00
|
|
|
{
|
2016-03-13 18:15:24 +00:00
|
|
|
if( arr[ key ] == undefined ) return key;
|
|
|
|
|
2016-03-12 19:30:33 +00:00
|
|
|
var i = 0;
|
2016-03-13 18:15:24 +00:00
|
|
|
return arr[ key ].replace( /%\d+/g, function( e )
|
2016-03-12 19:30:33 +00:00
|
|
|
{
|
|
|
|
return restArgs[ i ++ ];
|
|
|
|
} );
|
|
|
|
};
|
|
|
|
|
2016-03-13 18:15:24 +00:00
|
|
|
var Message = function( key )
|
|
|
|
{
|
|
|
|
var restArgs = Array.prototype.slice.call( arguments, 1 );
|
|
|
|
return GetString( messages, key, restArgs );
|
|
|
|
};
|
|
|
|
|
|
|
|
var Error = function( key )
|
|
|
|
{
|
|
|
|
var restArgs = Array.prototype.slice.call( arguments, 1 );
|
|
|
|
return GetString( errors, key, restArgs );
|
|
|
|
};
|
|
|
|
|
2016-03-12 19:30:33 +00:00
|
|
|
ns[ NS_EXPORT ]( EX_FUNC, "Message", Message );
|
2016-03-13 18:15:24 +00:00
|
|
|
ns[ NS_EXPORT ]( EX_FUNC, "Error", Error );
|
2016-03-12 19:30:33 +00:00
|
|
|
})();
|