Read 'theme' setting and return path to gutter icons.
(self)
| 119 | |
| 120 | @property |
| 121 | def theme_path(self): |
| 122 | """Read 'theme' setting and return path to gutter icons.""" |
| 123 | theme = self.get('theme') |
| 124 | if not theme: |
| 125 | theme = 'Default.gitgutter-theme' |
| 126 | # rebuilt path if setting changed |
| 127 | if theme != os.path.basename(self._theme_path): |
| 128 | if ST3: |
| 129 | themes = sublime.find_resources(theme) |
| 130 | self._theme_path = ( |
| 131 | os.path.dirname(themes[-1]) |
| 132 | if themes else self._PACKAGE_THEMES + '/Default') |
| 133 | else: |
| 134 | # ST2 doesn't support find_resource, use built-in themes only. |
| 135 | theme, _ = os.path.splitext(theme) |
| 136 | self._theme_path = '/'.join((self._PACKAGE_THEMES, theme)) |
| 137 | return self._theme_path |
| 138 | |
| 139 | @property |
| 140 | def git_binary(self): |