Skip to content

Commit 5200445

Browse files
committed
Fix bug where cursor text is searched for, but contains no content
1 parent 42dedae commit 5200445

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

advanced_new_file/commands/command_base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def __generate_alias_root(self):
4646
return path
4747

4848
def generate_initial_path(self, initial_path=None):
49+
path = None
4950
# Search for initial string
5051
if initial_path is not None:
5152
path = initial_path
@@ -54,7 +55,8 @@ def generate_initial_path(self, initial_path=None):
5455
cursor_text = self.get_cursor_path()
5556
if cursor_text != "":
5657
path = cursor_text
57-
else:
58+
59+
if path is None:
5860
path = self.settings.get(DEFAULT_INITIAL_SETTING)
5961

6062
return path
@@ -125,7 +127,7 @@ def split_path(self, path=""):
125127
try:
126128
root, path = self.platform.split(path)
127129
if self.settings.get(SHELL_INPUT_SETTING, False) and len(path) > 0:
128-
split_path = shlex.split(str(path))
130+
split_path = shlex.split(path)
129131
path = " ".join(split_path)
130132
# Parse if alias
131133
if TOP_LEVEL_SPLIT_CHAR in path and root is None:

0 commit comments

Comments
 (0)