Merge branch '2178_hardlink_highlight'

* 2178_hardlink_highlight:
  Changes for respect new 'HARDLINK' highlight type.
  Ticket #2478: HARDLINK file type
This commit is contained in:
Slava Zanko 2011-02-18 15:20:55 +02:00
commit d194d2478a
12 changed files with 21 additions and 5 deletions

View File

@ -80,6 +80,12 @@ mc_fhl_is_link (file_entry * fe)
return S_ISLNK (fe->st.st_mode);
}
inline static gboolean
mc_fhl_is_hlink (file_entry * fe)
{
return (fe->st.st_nlink > 1);
}
inline static gboolean
mc_fhl_is_link_to_dir (file_entry * fe)
{
@ -175,16 +181,14 @@ mc_fhl_get_color_filetype (mc_fhl_filter_t * mc_filter, mc_fhl_t * fhl, file_ent
my_color = TRUE;
break;
case MC_FLHGH_FTYPE_T_LINK:
if (mc_fhl_is_link (fe))
if ((mc_fhl_is_link (fe)) || (mc_fhl_is_hlink (fe)))
my_color = TRUE;
break;
case MC_FLHGH_FTYPE_T_HARDLINK:
/*TODO: hanlde it */
if (mc_fhl_is_link (fe))
if (mc_fhl_is_hlink (fe))
my_color = TRUE;
break;
case MC_FLHGH_FTYPE_T_SYMLINK:
/*TODO: hanlde it */
if (mc_fhl_is_link (fe))
my_color = TRUE;
break;

View File

@ -4,7 +4,6 @@
[directory]
type=DIR
[device]
type=DEVICE
@ -17,6 +16,9 @@
[symlink]
type=SYMLINK
[hardlink]
type=HARDLINK
[core]
regexp=^core\\.*\\d*$

View File

@ -58,6 +58,7 @@
directory=white;
executable=brightmagenta;
symlink=lightgray;
hardlink=
stalelink=brightred;
device=brightmagenta;
special=brightblue;

View File

@ -58,6 +58,7 @@
directory=white;
executable=brightmagenta;
symlink=lightgray;
hardlink=
stalelink=brightred;
device=brightmagenta;
special=brightblue;

View File

@ -59,6 +59,7 @@
directory=white;
executable=brightgreen;
symlink=lightgray;
hardlink=
stalelink=brightred;
device=brightmagenta;
special=black;

View File

@ -58,6 +58,7 @@
directory=white;
executable=brightgreen;
symlink=lightgray;
hardlink=
stalelink=brightred;
device=brightmagenta;
special=black;

View File

@ -60,6 +60,7 @@
directory=white;
executable=brightgreen;
symlink=lightgray;
hardlink=
stalelink=brightred;
device=brightmagenta;
special=black;

View File

@ -55,6 +55,7 @@
directory=brightcyan;
executable=brightgreen;
symlink=red;
hardlink=
stalelink=yellow;blue
device=green;
special=brightblue;

View File

@ -49,6 +49,7 @@
directory=blue;
executable=brightgreen;
symlink=gray;
hardlink=
stalelink=brightred;
device=brightmagenta;
special=gray;

View File

@ -102,6 +102,7 @@
directory=
executable=rgb030
symlink=rgb202
hardlink=
# 404 Not Found :)
stalelink=rgb404
device=rgb231

View File

@ -100,6 +100,7 @@
directory=;;bold
executable=color114
symlink=color180
hardlink=
stalelink=rgb404
device=rgb231
special=rgb331

View File

@ -31,6 +31,7 @@ context default
keyword SPECIAL brightred
keyword STALE_LINK brightred
keyword SYMLINK brightred
keyword HARDLINK brightred
context linestart # \n brown