Skip to content

Commit

Permalink
refactor: tidy codes
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
  • Loading branch information
jfcherng committed Sep 7, 2024
1 parent b514b11 commit cb201ae
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions plugin/data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,10 @@ def indent_pattern_compiled(self) -> Pattern[str]:
@classmethod
def from_view(cls, view: sublime.View) -> Self:
settings = view.settings()
tab_size = int(settings.get("tab_size", 4))
if settings.get("translate_tabs_to_spaces", False):
style = IndentStyle.SPACE
else:
style = IndentStyle.TAB
return cls(tab_size=tab_size, style=style)
return cls(
tab_size=int(settings.get("tab_size", 4)),
style=IndentStyle.SPACE if settings.get("translate_tabs_to_spaces", False) else IndentStyle.TAB,
)


class IndentStyle(StrEnum):
Expand Down

0 comments on commit cb201ae

Please sign in to comment.