Ticket #2324: fix of manually changing syntax definition.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Andrew Borodin 2010-08-26 21:06:23 +04:00
parent dcaf71004a
commit 37b49b3920

View File

@ -1369,6 +1369,7 @@ get_first_editor_line (WEdit * edit)
* Load rules into edit struct. Either edit or *pnames must be NULL. If
* edit is NULL, a list of types will be stored into names. If type is
* NULL, then the type will be selected according to the filename.
* type must be edit->syntax_type or NULL
*/
void
edit_load_syntax (WEdit * edit, char ***pnames, const char *type)
@ -1379,7 +1380,14 @@ edit_load_syntax (WEdit * edit, char ***pnames, const char *type)
if (option_auto_syntax)
type = NULL;
edit_free_syntax_rules (edit);
if (edit != NULL)
{
char *saved_type;
saved_type = g_strdup (type); /* save edit->syntax_type */
edit_free_syntax_rules (edit);
edit->syntax_type = saved_type; /* restore edit->syntax_type */
}
if (!tty_use_colors ())
return;