Skip to content

Commit

Permalink
refactor: file_name_unhidden should base on "lstrip()"
Browse files Browse the repository at this point in the history
Path.suffixes ignores all leading dots.

Signed-off-by: Jack Cherng <[email protected]>
  • Loading branch information
jfcherng committed Feb 23, 2024
1 parent b739584 commit 5a51a5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from .constants import VIEW_RUN_ID_SETTINGS_KEY
from .settings import get_merged_plugin_setting
from .utils import get_view_by_id, head_tail_content_st, remove_prefix
from .utils import get_view_by_id, head_tail_content_st


@dataclass
Expand Down Expand Up @@ -47,7 +47,7 @@ def file_name(self) -> str:
@property
def file_name_unhidden(self) -> str:
"""The file name without prefixed dots. Empty string if not on a disk."""
return remove_prefix(self.file_name, ".")
return self.file_name.lstrip(".")

@property
def file_path(self) -> str:
Expand Down

0 comments on commit 5a51a5c

Please sign in to comment.