syntax switching



Hi!

I am using mc shipped by fedora and I do not know exactly about proposed feature in the mc development stage.

Arny (one of developers of MPlayer) made patch for mc old version. I catch the syntax highlighting toggle feature from it and adopt to a last FC package. I hope, the switcher of syntax highlightind is a usefull feature and should like to be added to mainstream.

Thank you and please consider attached patch.

--
With best regards,
Andy Shevchenko.      mailto: andy smile org ua



--- mc-4.6.1a/edit/edit.c.amc	2005-11-11 14:41:30.000000000 +0200
+++ mc-4.6.1a/edit/edit.c	2005-11-11 14:41:31.000000000 +0200
@@ -2597,6 +2597,11 @@ edit_execute_cmd (WEdit *edit, int comma
 	edit_insert_file_cmd (edit);
 	break;
 
+    case CK_Toggle_Syntax:
+	option_syntax_highlighting ^= 1;
+	edit->force |= REDRAW_PAGE;
+	break;
+
     case CK_Find:
 	edit_search_cmd (edit, 0);
 	break;
--- mc-4.6.1a/edit/editcmddef.h.amc	2005-07-20 14:56:30.000000000 +0300
+++ mc-4.6.1a/edit/editcmddef.h	2005-11-11 14:41:31.000000000 +0200
@@ -108,6 +108,8 @@
 #define CK_Check_Save_And_Quit	457
 #define CK_Maximize		458
 
+#define CK_Toggle_Syntax	480
+
 /* macro */
 #define CK_Begin_Record_Macro	501
 #define CK_End_Record_Macro	502
--- mc-4.6.1a/edit/editkeys.c.amc	2005-11-11 14:41:30.000000000 +0200
+++ mc-4.6.1a/edit/editkeys.c	2005-11-11 18:56:16.000000000 +0200
@@ -112,6 +112,7 @@ static const edit_key_map_type common_ke
     { XCTRL ('k'), CK_Delete_To_Line_End },
     { XCTRL ('l'), CK_Refresh },
     { XCTRL ('o'), CK_Shell },
+    { XCTRL ('s'), CK_Toggle_Syntax },
     { XCTRL ('u'), CK_Undo },
     { XCTRL ('t'), CK_Select_Codepage },
     { XCTRL ('q'), CK_Insert_Literal },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]