Skip to content

Commit

Permalink
remove more lines
Browse files Browse the repository at this point in the history
  • Loading branch information
predragnikolic committed Jun 27, 2024
1 parent 2acceb6 commit 9ab9dc5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions plugin/rename_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@


class RenameFileInputHandler(sublime_plugin.TextInputHandler):
def want_event(self) -> bool:
return False

def __init__(self, path: str) -> None:
self.path = path

Expand All @@ -26,10 +23,8 @@ 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)
return [(0, end_point)]
name, _ext = os.path.splitext(self.path)
return [(0, len(name))]

def validate(self, path: str) -> bool:
return len(path) > 0
Expand Down

0 comments on commit 9ab9dc5

Please sign in to comment.