Browse files

add a clear command

  • Loading branch information...
1 parent e79573f commit 538540dc8af24934ae84d940a1e6c81babc2f55c @rctay committed Apr 4, 2012
Showing with 9 additions and 0 deletions.
  1. +4 −0 Default.sublime-commands
  2. +5 −0 clipboard.py
View
4 Default.sublime-commands
@@ -2,5 +2,9 @@
{
"caption": "Clipboard History",
"command": "clipboard_display"
+ },
+ {
+ "caption": "Clear Clipboard History",
+ "command": "clipboard_clear"
}
]
View
5 clipboard.py
@@ -29,6 +29,11 @@ def panel_done(self, picked):
self.view.run_command('paste')
+class ClipboardClearCommand(sublime_plugin.TextCommand):
+ def run(self, edit):
+ del history[0:]
+
+
# Here we see a cunning plan. We listen for a key, but never say we
# support it. This lets us respond to ctrl-c and ctrl-x, without having
# to re-implement the copy and cut commands. (Important, since

0 comments on commit 538540d

Please sign in to comment.