mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-05 09:36:18 +00:00
Quit command should abort any pending commands
This commit is contained in:
parent
4b1affee50
commit
37f6930bf2
@ -38,6 +38,13 @@ Commander.prototype.log = function(str) {
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Clear pending commands
|
||||
*/
|
||||
Commander.prototype.clearCommands = function() {
|
||||
this.commandTokens = this.commandTokens.slice(0,this.nextToken);
|
||||
};
|
||||
|
||||
/*
|
||||
Write a string if verbose flag is set
|
||||
*/
|
||||
|
@ -25,6 +25,8 @@ var Command = function(params,commander,callback) {
|
||||
};
|
||||
|
||||
Command.prototype.execute = function() {
|
||||
// Clear any pending commands
|
||||
this.commander.clearCommands();
|
||||
// We don't actually quit, we just issue the "th-quit" hook to give listeners a chance to exit
|
||||
$tw.hooks.invokeHook("th-quit");
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user