/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to diff.py

  • Committer: Tarmac
  • Author(s): Edward Ari Bichetero
  • Date: 2011-02-15 00:12:57 UTC
  • mfrom: (699.1.1 bzr-gtk)
  • Revision ID: tarmac-20110215001257-rcuxe3hbhwuym29k
Fix a crash in 'bzr gdiff' when the user has a gedit highlighting scheme that is also not in the system-wide gedit styles directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
        :param buf: a gtksourceview2.Buffer object.
106
106
        """
107
107
        GEDIT_SCHEME_PATH = '/apps/gedit-2/preferences/editor/colors/scheme'
 
108
        GEDIT_USER_STYLES_PATH = os.path.expanduser('~/.gnome2/gedit/styles')
108
109
 
109
110
        client = gconf.client_get_default()
110
111
        style_scheme_name = client.get_string(GEDIT_SCHEME_PATH)
111
112
        if style_scheme_name is not None:
112
 
            style_scheme = gtksourceview2.StyleSchemeManager().get_scheme(style_scheme_name)
113
 
            
114
 
            buf.set_style_scheme(style_scheme)
 
113
            style_scheme_mgr = gtksourceview2.StyleSchemeManager()
 
114
            style_scheme_mgr.append_search_path(GEDIT_USER_STYLES_PATH)
 
115
            
 
116
            style_scheme = style_scheme_mgr.get_scheme(style_scheme_name)
 
117
            
 
118
            if style_scheme is not None:
 
119
                buf.set_style_scheme(style_scheme)
115
120
 
116
121
    @classmethod
117
122
    def apply_colordiff_colors(klass, buf):