diff --git a/plugin/rename_file.py b/plugin/rename_file.py index fe2e59ac6..b109bf6a3 100644 --- a/plugin/rename_file.py +++ b/plugin/rename_file.py @@ -13,26 +13,24 @@ class RenameFileInputHandler(sublime_plugin.TextInputHandler): def want_event(self) -> bool: return False - def __init__(self, path: str) -> None: - self.path = path + def __init__(self, file_name: str) -> None: + self.file_name = file_name def name(self) -> str: return "new_name" def placeholder(self) -> str: - return self.path + return self.file_name def initial_text(self) -> str: return self.placeholder() def initial_selection(self) -> list[tuple[int, int]]: - end_point = self.path.rfind('.') - if end_point == -1: - end_point = len(self.path) + end_point = self.file_name.rfind('.') return [(0, end_point)] - def validate(self, path: str) -> bool: - return len(path) > 0 + def validate(self, name: str) -> bool: + return len(name) > 0 class LspRenameFileCommand(LspWindowCommand):