Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-19fa
git_rec_nano
Commits
704a7d7b
Commit
704a7d7b
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: rename two variables, for preciseness and shortness
Also remove an unneeded nulling.
parent
64366d99
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/color.c
+10
-11
src/color.c
src/global.c
+2
-2
src/global.c
src/proto.h
+1
-1
src/proto.h
src/rcfile.c
+6
-6
src/rcfile.c
with
19 additions
and
20 deletions
+19
-20
src/color.c
View file @
704a7d7b
...
...
@@ -57,16 +57,16 @@ void set_colorpairs(void)
/* Initialize the color pairs for nano's interface elements. */
for
(
i
=
0
;
i
<
NUMBER_OF_ELEMENTS
;
i
++
)
{
colortype
*
co
lor
=
specified_
color_combo
[
i
];
if
(
co
lor
!=
NULL
)
{
if
(
co
lor
->
fg
==
-
1
&&
!
using_defaults
)
co
lor
->
fg
=
COLOR_WHITE
;
if
(
co
lor
->
bg
==
-
1
&&
!
using_defaults
)
co
lor
->
bg
=
COLOR_BLACK
;
init_pair
(
i
+
1
,
co
lor
->
fg
,
co
lor
->
bg
);
colortype
*
co
mbo
=
color_combo
[
i
];
if
(
co
mbo
!=
NULL
)
{
if
(
co
mbo
->
fg
==
-
1
&&
!
using_defaults
)
co
mbo
->
fg
=
COLOR_WHITE
;
if
(
co
mbo
->
bg
==
-
1
&&
!
using_defaults
)
co
mbo
->
bg
=
COLOR_BLACK
;
init_pair
(
i
+
1
,
co
mbo
->
fg
,
co
mbo
->
bg
);
interface_color_pair
[
i
]
=
COLOR_PAIR
(
i
+
1
)
|
A_BANDAID
|
(
co
lor
->
bright
?
A_BOLD
:
A_NORMAL
);
(
co
mbo
->
bright
?
A_BOLD
:
A_NORMAL
);
}
else
{
if
(
i
!=
FUNCTION_TAG
)
interface_color_pair
[
i
]
=
hilite_attribute
;
...
...
@@ -74,8 +74,7 @@ void set_colorpairs(void)
interface_color_pair
[
i
]
=
A_NORMAL
;
}
free
(
specified_color_combo
[
i
]);
specified_color_combo
[
i
]
=
NULL
;
free
(
color_combo
[
i
]);
}
/* For each syntax, go through its list of colors and assign each
...
...
This diff is collapsed.
Click to expand it.
src/global.c
View file @
704a7d7b
...
...
@@ -233,8 +233,8 @@ regmatch_t regmatches[10];
int
hilite_attribute
=
A_REVERSE
;
/* The curses attribute we use to highlight something. */
#ifdef ENABLE_COLOR
colortype
*
specified_
color_combo
[]
=
{
NULL
};
/* The color combinations
as specified
in the rcfile. */
colortype
*
color_combo
[]
=
{
NULL
};
/* The color combinations
for interface elements given
in the rcfile. */
#endif
int
interface_color_pair
[]
=
{
0
};
/* The processed color pairs for the interface elements. */
...
...
This diff is collapsed.
Click to expand it.
src/proto.h
View file @
704a7d7b
...
...
@@ -172,7 +172,7 @@ extern regmatch_t regmatches[10];
extern
int
hilite_attribute
;
#ifdef ENABLE_COLOR
extern
colortype
*
specified_
color_combo
[
NUMBER_OF_ELEMENTS
];
extern
colortype
*
color_combo
[
NUMBER_OF_ELEMENTS
];
#endif
extern
int
interface_color_pair
[
NUMBER_OF_ELEMENTS
];
...
...
This diff is collapsed.
Click to expand it.
src/rcfile.c
View file @
704a7d7b
...
...
@@ -1098,17 +1098,17 @@ void parse_rcfile(FILE *rcstream, bool syntax_only)
#ifdef ENABLE_COLOR
if
(
strcasecmp
(
rcopts
[
i
].
name
,
"titlecolor"
)
==
0
)
specified_
color_combo
[
TITLE_BAR
]
=
parse_interface_color
(
option
);
color_combo
[
TITLE_BAR
]
=
parse_interface_color
(
option
);
else
if
(
strcasecmp
(
rcopts
[
i
].
name
,
"numbercolor"
)
==
0
)
specified_
color_combo
[
LINE_NUMBER
]
=
parse_interface_color
(
option
);
color_combo
[
LINE_NUMBER
]
=
parse_interface_color
(
option
);
else
if
(
strcasecmp
(
rcopts
[
i
].
name
,
"selectedcolor"
)
==
0
)
specified_
color_combo
[
SELECTED_TEXT
]
=
parse_interface_color
(
option
);
color_combo
[
SELECTED_TEXT
]
=
parse_interface_color
(
option
);
else
if
(
strcasecmp
(
rcopts
[
i
].
name
,
"statuscolor"
)
==
0
)
specified_
color_combo
[
STATUS_BAR
]
=
parse_interface_color
(
option
);
color_combo
[
STATUS_BAR
]
=
parse_interface_color
(
option
);
else
if
(
strcasecmp
(
rcopts
[
i
].
name
,
"keycolor"
)
==
0
)
specified_
color_combo
[
KEY_COMBO
]
=
parse_interface_color
(
option
);
color_combo
[
KEY_COMBO
]
=
parse_interface_color
(
option
);
else
if
(
strcasecmp
(
rcopts
[
i
].
name
,
"functioncolor"
)
==
0
)
specified_
color_combo
[
FUNCTION_TAG
]
=
parse_interface_color
(
option
);
color_combo
[
FUNCTION_TAG
]
=
parse_interface_color
(
option
);
else
#endif
#ifdef ENABLE_OPERATINGDIR
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help