Skip to content

Commit 55dd878

Browse files
committed
Minor fixes from refactoring
1 parent 81fafe4 commit 55dd878

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

advanced_new_file/commands/copy_file_command.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ def entered_file_action(self, path):
3434
print("Exception: %s '%s'" % (e.strerror, e.filename))
3535

3636
if attempt_copy:
37-
if self._copy_file(path):
38-
self.open_file(path)
37+
copy_success, new_file = self._copy_file(path)
38+
if copy_success:
39+
self.open_file(new_file)
3940

4041
def _copy_file(self, path):
4142
if os.path.isdir(path) or re.search(r"(/|\\)$", path):
@@ -52,7 +53,7 @@ def _copy_file(self, path):
5253
copied = False
5354
sublime.error_message("Unable to copy file. No source file to move")
5455

55-
return copied
56+
return (copied, path)
5657

5758
def copy_from_view(self, source_view, target):
5859
source = source_view.file_name()

advanced_new_file/commands/duplicate_file_base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ def is_copy_original_name(self, path):
6262

6363
def try_append_extension(self, path):
6464
append_setting = self.get_append_extension_setting()
65-
print(append_setting)
66-
print(self.settings.get(append_setting))
6765
if self.settings.get(append_setting, False):
6866
if not self.is_copy_original_name(path):
6967
_, new_path_extension = os.path.splitext(path)

advanced_new_file/commands/move_file_command.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,11 @@ def move_from_view(self, source_view, target):
8484
self.open_file(target)
8585

8686
def move_file_from_disk(self, source, target):
87+
window = self.window
8788
self.view.run_command("save")
8889
window.focus_view(self.view)
8990
window.run_command("close")
90-
self._move_action(filename, file_path)
91+
self._move_action(source, target)
9192

9293
def move_file_from_buffer(self, source_view, target):
9394
window = self.window

0 commit comments

Comments
 (0)