mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-10 21:42:00 +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
|
* 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
|
* 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.
|
* NULL, then the type will be selected according to the filename.
|
||||||
|
* type must be edit->syntax_type or NULL
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
edit_load_syntax (WEdit * edit, char ***pnames, const char *type)
|
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)
|
if (option_auto_syntax)
|
||||||
type = NULL;
|
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 ())
|
if (!tty_use_colors ())
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user