From 5143ea18280e2b0a7986d8e748ca99e5ed91aeee Mon Sep 17 00:00:00 2001 From: anekos Date: Tue, 9 Mar 2010 14:18:32 +0000 Subject: :sm delete hoge を追加 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@36972 d0d07461-0603-4401-acd4-de1884942a52 --- session-manager.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'session-manager.js') diff --git a/session-manager.js b/session-manager.js index 2cc66dd..7d4c39d 100755 --- a/session-manager.js +++ b/session-manager.js @@ -38,7 +38,7 @@ let PLUGIN_INFO = Session Manager Session Manager for Session Manager Addon - 1.0.1 + 1.1.0 anekos new BSD License (Please read the source code comments of this plugin) 修正BSDライセンス (ソースコードのコメントを参照してください) @@ -127,11 +127,20 @@ let INFO = load: function (name) { gSessionManager.load(fixFilename(name), 'overwrite'); liberator.echo('Session loaded: '+ name); + }, + delete: function (name) { + let file = File(fixFilename(name)); + if (!file.exists()) + return liberator.echoerr('file does not exist: ' + name); + file.remove(); + liberator.echo('Session removed: '+ name); } }; alias(SubCommands, 'save', 's'); alias(SubCommands, 'load', 'l'); + alias(SubCommands, 'delete', 'd'); + alias(SubCommands, 'delete', 'del'); commands.addUserCommand( ['sessionmanager', 'sm'], @@ -149,6 +158,7 @@ let INFO = context.completions = [ ['save', 'Save current session'], ['load', 'Load saved session (overwrite)'], + ['delete', 'Remove saved session'], ]; return; } -- cgit v1.2.3