Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I edited one of gedit's language files (syntax highlighting) and – to test the changes – changed the language of an open file to another one and then back. I did this a couple of times, but the last time, gedit crashes (and made rsyslogd crash in the process).

I tried to reopen the file, but gedit immediately crashes. This is what I've tried:

  • Since I changed the syntax syntax highlighting, I tried opening files with the same extension.

  • I tried deleting lines from the file that may be affected by the changes.
    Works if the file is empty, but doesn't work if I leave even a single character.

  • I tried renaming the file in case gedit "remembers" something about it.
    Doesn't work.

  • I tried copying the file with Nautilus and opening the new file.
    Doesn't work.

  • I tried copying and pasting the contents from the file into another one and opening the new file.

  • I tried copying the file from the command line and opening the new file.

Any ideas what could have caused this and how to fix it properly?

share|improve this question
up vote 1 down vote accepted

After adding the tags, a similar question appeared in the Related tab (same problem, different cause, and user Renan suggested in the comments to run gedit from the terminal and look for error messages.

This was the output:

GtkSourceView:ERROR:gtksourcecontextengine.c:5421:update_syntax: assertion failed: (state->context != NULL)
Aborted (core dumped)

This is caused by a bug in gedit that gets triggered when setting the language to Defaults. Since this selection gets saved in the GnomeVFS, even copying the file in Nautilus doesn't help, since it preserves the metadata.

To solve this problem, as indicated in the bug report, I executed the following command:

gvfs-set-attribute FILENAME metadata::gedit-language ''


share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .