Skip to content

Commit

Permalink
Fix fallback logic for view settings (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaste authored Jul 15, 2021
1 parent 2758196 commit df670bd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions origami.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,9 @@ def on_close(self, view):

def on_pre_close(self, view):
# Read from global settings for backward compatibility
auto_close = view.settings().get("origami_auto_close_empty_panes", False)
auto_close = self.settings().get("auto_close_empty_panes", auto_close)
auto_close = view.settings().get("origami_auto_close_empty_panes")
if auto_close is None:
auto_close = self.settings().get("auto_close_empty_panes")
if not auto_close:
return

Expand Down Expand Up @@ -810,8 +811,9 @@ def on_activated(self, view):
if self.running:
return
# Read from global settings for backward compatibility
fraction = view.settings().get("origami_auto_zoom_on_focus", False)
fraction = self.settings().get("auto_zoom_on_focus", fraction)
fraction = view.settings().get("origami_auto_zoom_on_focus")
if fraction is None:
fraction = self.settings().get("auto_zoom_on_focus")
if not fraction:
return
if view.settings().get("is_widget"):
Expand Down

0 comments on commit df670bd

Please sign in to comment.