Skip to content

nemo-preview: fix missing syntax highlighting in text previews#583

Open
Boccolarg wants to merge 1 commit into
linuxmint:masterfrom
Boccolarg:nemo-preview-syntax-highlighting
Open

nemo-preview: fix missing syntax highlighting in text previews#583
Boccolarg wants to merge 1 commit into
linuxmint:masterfrom
Boccolarg:nemo-preview-syntax-highlighting

Conversation

@Boccolarg
Copy link
Copy Markdown

GtkSourceView highlights only when the buffer has both a language and a
resolvable style scheme. Neither was guaranteed:

  • No language was ever assigned to the loaded buffer.
  • The scheme name comes from the Xed editor settings, but the default
    StyleSchemeManager doesn't search the editor style dirs
    (/xed/styles, /gedit/styles), so user-installed
    schemes resolved to null and cleared all colors.

Register those search paths, guess the language from the file name and
content type, and skip applying an unresolved (null) scheme.

GtkSourceView highlights only when the buffer has both a language and a
resolvable style scheme. Neither was guaranteed:

- No language was ever assigned to the loaded buffer.
- The scheme name comes from the Xed editor settings, but the default
  StyleSchemeManager doesn't search the editor style dirs
  (<data dir>/xed/styles, <data dir>/gedit/styles), so user-installed
  schemes resolved to null and cleared all colors.

Register those search paths, guess the language from the file name and
content type, and skip applying an unresolved (null) scheme.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant