Skip to content

Commit

Permalink
renamed DeleteCurrentFile to avoid conflict with built in command del…
Browse files Browse the repository at this point in the history
…ete_file
  • Loading branch information
yaworsw committed Jul 22, 2013
1 parent e210598 commit 489f4d1
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions DeleteFile.py → DeleteCurrentFile.py
@@ -1,8 +1,8 @@
import sublime, sublime_plugin, os

settings = sublime.load_settings('DeleteFile.sublime-settings')
settings = sublime.load_settings('DeleteCurrentFile.sublime-settings')

class DeleteFileCommand(sublime_plugin.TextCommand):
class DeleteCurrentFileCommand(sublime_plugin.TextCommand):
def run(self, edit, prompt_before_delete=None, auto_close_buffer=None):

if prompt_before_delete == None:
Expand All @@ -20,8 +20,8 @@ def run(self, edit, prompt_before_delete=None, auto_close_buffer=None):
if not sublime.ok_cancel_dialog('Are you sure you want to delete \'%s\'?' % file):
return

if (file != None and os.path.isfile(view.file_name())):
os.remove(file)

if auto_close_buffer:
window.run_command('close')

if (file != None and os.path.isfile(view.file_name())):
os.remove(file)
@@ -1,6 +1,6 @@
[
{
"caption": "File: Delete",
"command": "delete_file"
"command": "delete_current_file"
}
]
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions Main.sublime-menu
Expand Up @@ -12,18 +12,18 @@
"children":
[
{
"caption": "DeleteFile",
"caption": "DeleteCurrentFile",
"children":
[
{
"caption": "Settings – Default",
"command": "open_file",
"args": { "file": "${packages}/DeleteFile/DeleteFile.sublime-settings" },
"args": { "file": "${packages}/DeleteFile/DeleteCurrentFile.sublime-settings" },
},
{
"caption": "Settings – User",
"command": "open_file",
"args": { "file": "${packages}/User/DeleteFile.sublime-settings" }
"args": { "file": "${packages}/User/DeleteCurrentFile.sublime-settings" }
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,3 +1,3 @@
# Sublime-DeleteFile
# Sublime-DeleteCurrentFile

This plugin adds a command to the command palette which will delete the current file and close the buffer.

0 comments on commit 489f4d1

Please sign in to comment.