Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.
    Works.

  • 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.
    Works.

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

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

share|improve this question
add comment

1 Answer

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 ''

Solved.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.