Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove command added

  • Loading branch information...
commit 385e09deb1c0e7b96ac6a44eeebdb63f3a11215c 1 parent a66d757
Tomek Wytrębowicz authored
View
4 Default.sublime-commands
@@ -28,6 +28,10 @@
"command": "vlt_resolve"
},
{
+ "caption": "vlt: Remove",
+ "command": "vlt_remove"
+ },
+ {
"caption": "vlt: Revert...",
"command": "vlt_revert_choice"
},
View
3  messages.json
@@ -4,5 +4,6 @@
"0.1.2": "messages/0.1.2.txt",
"0.1.3": "messages/0.1.3.txt",
"0.1.4": "messages/0.1.4.txt",
- "0.1.5": "messages/0.1.5.txt"
+ "0.1.5": "messages/0.1.5.txt",
+ "0.1.6": "messages/0.1.6.txt"
}
View
4 messages/0.1.6.txt
@@ -0,0 +1,4 @@
+Vlt integration 0.1.6 changelog:
+
+Features:
+ - Remove command removes opened file.
View
15 vlt.py
@@ -53,7 +53,7 @@ def ConstructCommand(in_command):
def VltCommandOnFile(in_command, in_folder, in_filename):
command = ConstructCommand('vlt ' + in_command + ' "' + in_filename + '"')
- #print "vlt [debug]: " + (vlt_root(in_folder) or "[no-vlt repo]") + ': '+ 'vlt ' + in_command + ' "' + in_filename + '"'
+ print "vlt [debug]: " + (vlt_root(in_folder) or "[no-vlt repo]") + ': '+ 'vlt ' + in_command + ' "' + in_filename + '"'
p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=in_folder, shell=True)
result, err = p.communicate()
@@ -137,13 +137,13 @@ def run_command(self, command, callback=None, show_status=True,
s = sublime.load_settings("vlt.sublime-settings")
if s.get('save_first') and self.active_view() and self.active_view().is_dirty() and not no_save:
- #print "vlt[debug] save first"
+ print "vlt[debug] save first"
self.active_view().run_command('save')
if command[0] == 'vlt' and s.get('vlt_command'):
command[0] = s.get('vlt_command')
#if not callback:
# callback = self.generic_done
- #print "vlt[debug]: " + ' '.join(command)
+ print "vlt[debug]: " + ' '.join(command)
thread = CommandThread(command, callback, **kwargs)
thread.start()
@@ -340,7 +340,7 @@ def run(self, edit):
def commit_done(self, result):
sublime.status_message(result)
- #print "vlt[debug]: " + result
+ print "vlt[debug]: " + result
class VltAutoCommit(sublime_plugin.EventListener):
@@ -490,6 +490,13 @@ def commit_done(self, result):
else:
sublime.status_message(result)
+class VltRemoveCommand(VltTextCommand):
+ def run(self, edit):
+ self.run_command(['vlt', 'rm', os.path.join(self.get_working_dir(), self.get_file_name())], self.commit_done, True)
+
+ def commit_done(self, result):
+ sublime.status_message(result)
+
class VltRevertChoiceCommand(VltStatusCommand):
#VltStatusCommand):
View
BIN  vlt.pyc
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.