The following commit has been merged in the master branch:
commit 0ac261de1b67e1b4fe9048d47607ecfecfa02b8f
Author: Andrew Borodin <
abor...@vmail.ru>
Date: Mon Oct 29 17:20:54 2012 +0400
Init file highlighting only in full mode.
Signed-off-by: Andrew Borodin <
abor...@vmail.ru>
diff --git a/src/filemanager/midnight.c b/src/filemanager/midnight.c
index 9c0184a..6049ca8 100644
--- a/src/filemanager/midnight.c
+++ b/src/filemanager/midnight.c
@@ -1759,17 +1759,19 @@ do_nc (void)
midnight_dlg = create_dlg (FALSE, 0, 0, LINES, COLS, midnight_colors, midnight_callback,
midnight_event, "[main]", NULL, DLG_WANT_IDLE);
- if (mc_global.mc_run_mode == MC_RUN_FULL)
- setup_mc ();
- else
- setup_dummy_mc ();
-
/* Check if we were invoked as an editor or file viewer */
if (mc_global.mc_run_mode != MC_RUN_FULL)
+ {
+ setup_dummy_mc ();
ret = mc_maybe_editor_or_viewer ();
+ }
else
{
+ setup_mc ();
+ mc_filehighlight = mc_fhl_new (TRUE);
create_panels_and_run_mc ();
+ mc_fhl_free (&mc_filehighlight);
+
ret = TRUE;
/* destroy_dlg destroys even current_panel->cwd_vpath, so we have to save a copy :) */
diff --git a/src/filemanager/panel.c b/src/filemanager/panel.c
index 39b9bb9..ac52a80 100644
--- a/src/filemanager/panel.c
+++ b/src/filemanager/panel.c
@@ -44,7 +44,6 @@
#include "lib/tty/key.h" /* XCTRL and ALT macros */
#include "lib/skin.h"
#include "lib/strescape.h"
-#include "lib/filehighlight.h"
#include "lib/mcconfig.h"
#include "lib/vfs/vfs.h"
#include "lib/unixcompat.h"
@@ -308,6 +307,8 @@ panel_field_t panel_fields[] = {
};
/* *INDENT-ON* */
+mc_fhl_t *mc_filehighlight = NULL;
+
extern int saving_setup;
/*** file scope macro definitions ****************************************************************/
diff --git a/src/filemanager/panel.h b/src/filemanager/panel.h
index 62b9298..00ca210 100644
--- a/src/filemanager/panel.h
+++ b/src/filemanager/panel.h
@@ -11,6 +11,7 @@
#include "lib/fs.h" /* MC_MAXPATHLEN */
#include "lib/strutil.h"
#include "lib/widget.h" /* Widget */
+#include "lib/filehighlight.h"
#include "dir.h" /* dir_list */
@@ -146,6 +147,8 @@ extern panel_field_t panel_fields[];
extern hook_t *select_file_hook;
+extern mc_fhl_t *mc_filehighlight;
+
/*** declarations of public functions ************************************************************/
WPanel *panel_new (const char *panel_name);
diff --git a/src/main.c b/src/main.c
index 8e68166..c25d72e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -357,7 +357,6 @@ main (int argc, char *argv[])
error = NULL;
}
- mc_filehighlight = mc_fhl_new (TRUE);
dlg_set_default_colors ();
#ifdef ENABLE_SUBSHELL
@@ -402,7 +401,6 @@ main (int argc, char *argv[])
flush_extension_file (); /* does only free memory */
- mc_fhl_free (&mc_filehighlight);
mc_skin_deinit ();
tty_colors_done ();
diff --git a/src/setup.c b/src/setup.c
index ecaa66d..c39957f 100644
--- a/src/setup.c
+++ b/src/setup.c
@@ -35,7 +35,6 @@
#include "lib/global.h"
-#include "lib/filehighlight.h"
#include "lib/tty/tty.h"
#include "lib/tty/key.h"
#include "lib/mcconfig.h"
@@ -191,8 +190,6 @@ gboolean is_autodetect_codeset_enabled = FALSE;
/* If set, then print to the given file the last directory we were at */
char *last_wd_string = NULL;
-mc_fhl_t *mc_filehighlight;
-
/* Set when main loop should be terminated */
int quit = 0;
diff --git a/src/setup.h b/src/setup.h
index f40be38..4ec473d 100644
--- a/src/setup.h
+++ b/src/setup.h
@@ -120,8 +120,6 @@ extern int quit;
/* Set to TRUE to suppress printing the last directory */
extern gboolean print_last_revert;
-extern struct mc_fhl_struct *mc_filehighlight;
-
extern char *shell;
extern const char *mc_prompt;
--
Midnight Commander Development