Skip to content

Commit e1a7183

Browse files
committed
Various bug fixes
1 parent 7aeffc6 commit e1a7183

5 files changed

Lines changed: 9 additions & 7 deletions

File tree

advanced_new_file/commands/command_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def entered_filename(self, filename):
261261
file_path = generate_creation_path(self.settings, base, path, True)
262262
# Check for invalid alias specified.
263263
is_valid = (TOP_LEVEL_SPLIT_CHAR in filename and
264-
self.platform.is_absolute_path(base))
264+
not self.platform.is_absolute_path(base))
265265
if is_valid:
266266
if base == "":
267267
error_message = "Current file cannot be resolved."

advanced_new_file/commands/delete_file_command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ def _delete_file(self, filepath):
6262
file_view = self._find_open_file(filepath)
6363
if file_view is not None:
6464
file_view.set_scratch(True)
65-
window.focus_view(file_view)
66-
window.run_command("close")
65+
self.window.focus_view(file_view)
66+
self.window.run_command("close")
6767
self.refresh_sidebar()

advanced_new_file/commands/git/git_command_base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def _test_paths_for_executable(paths, test_file):
1111
if os.path.exists(file_path) and os.access(file_path, os.X_OK):
1212
return file_path
1313

14+
1415
def find_git():
1516
# It turns out to be difficult to reliably run git, with varying paths
1617
# and subprocess environments across different platforms. So. Let's hack
@@ -42,6 +43,7 @@ def find_git():
4243

4344
GIT = find_git()
4445

46+
4547
# Base for git commands
4648
class GitCommandBase(object):
4749
def __init__(self, window):
@@ -52,11 +54,11 @@ def file_tracked_by_git(self, filepath):
5254
git = GIT
5355
if git is not None:
5456
path, file_name = os.path.split(filepath)
55-
return self.run_command(["ls-files", file_name, "--error-unmatch"], path) == 0
57+
return self.run_command(
58+
["ls-files", file_name, "--error-unmatch"], path) == 0
5659
else:
5760
return False
5861

5962
def run_command(self, args, cwd):
6063
use_shell = PLATFORM == "windows"
6164
return subprocess.call([GIT] + args, cwd=cwd, shell=use_shell)
62-

advanced_new_file/commands/move_file_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ def run(self, is_python=False, initial_path=None, rename_file=None):
2121
path = self.settings.get(RENAME_DEFAULT_SETTING)
2222
current_file = self.view.file_name()
2323
if current_file:
24+
path = path.replace("<filepath>", current_file)
2425
current_file_name = os.path.basename(self.view.file_name())
2526
else:
2627
current_file_name = ""
2728

28-
path = path.replace("<filepath>", current_file)
2929
path = path.replace("<filename>", current_file_name)
3030
self.show_filename_input(
3131
path if len(path) > 0 else self.generate_initial_path())

advanced_new_file/completions/completion_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def __init__(self, command):
1515
def is_home(self, path):
1616
return re.match(r"^~[/\\]", path)
1717

18-
def is_alias(self, path_):
18+
def is_alias(self, path):
1919
return self.top_level_split_char in path
2020

2121
def generate_completion_list(self, path_in):

0 commit comments

Comments
 (0)