From 3647f92a3c0b1b53e9f11d01606eeab0e27ac2f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D1=80=D0=B5=D0=B4=D1=80=D0=B0=D0=B3=20=D0=9D=D0=B8?= =?UTF-8?q?=D0=BA=D0=BE=D0=BB=D0=B8=D1=9B?= Date: Thu, 27 Jun 2024 23:41:02 +0200 Subject: [PATCH] avoid multiple statements on one line --- plugin/rename_file.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugin/rename_file.py b/plugin/rename_file.py index d183b81d4..b886109e0 100644 --- a/plugin/rename_file.py +++ b/plugin/rename_file.py @@ -64,7 +64,8 @@ def run( view = self.window.active_view() old_path = self.get_old_path(dirs, files, view) if old_path is None: # handle renaming buffers - if view: view.set_name(new_name) + if view: + view.set_name(new_name) return new_path = os.path.normpath(Path(old_path).parent / new_name) if os.path.exists(new_path): @@ -87,9 +88,12 @@ def run( ) def get_old_path(self, dirs: list[str] | None, files: list[str] | None, view: sublime.View | None) -> str | None: - if dirs: return dirs[0] - if files: return files[0] - if view: return view.file_name() + if dirs: + return dirs[0] + if files: + return files[0] + if view: + return view.file_name() def handle(self, res: WorkspaceEdit | None, session_name: str, old_path: str, new_path: str, rename_file_params: RenameFilesParams) -> None: