mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
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:
parent
dcaf71004a
commit
37b49b3920
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user