Skip to content
GitLab
Menu
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
960e848c
Commit
960e848c
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: elide a typedef, as it now has just one element
parent
b4737072
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
src/color.c
+3
-3
src/color.c
src/global.c
+1
-1
src/global.c
src/nano.c
+4
-4
src/nano.c
src/nano.h
+0
-6
src/nano.h
src/prompt.c
+4
-4
src/prompt.c
src/proto.h
+1
-1
src/proto.h
src/winio.c
+8
-8
src/winio.c
with
21 additions
and
27 deletions
+21
-27
src/color.c
View file @
960e848c
...
...
@@ -62,14 +62,14 @@ void set_colorpairs(void)
if
(
background
==
-
1
&&
!
using_defaults
)
background
=
COLOR_BLACK
;
init_pair
(
i
+
1
,
foreground
,
background
);
interface_color_pair
[
i
]
.
pairnum
=
interface_color_pair
[
i
]
=
COLOR_PAIR
(
i
+
1
)
|
(
bright
?
A_BOLD
:
A_NORMAL
);
}
else
{
if
(
i
!=
FUNCTION_TAG
)
interface_color_pair
[
i
]
.
pairnum
=
hilite_attribute
;
interface_color_pair
[
i
]
=
hilite_attribute
;
else
interface_color_pair
[
i
]
.
pairnum
=
A_NORMAL
;
interface_color_pair
[
i
]
=
A_NORMAL
;
}
free
(
specified_color_combo
[
i
]);
...
...
This diff is collapsed.
Click to expand it.
src/global.c
View file @
960e848c
...
...
@@ -212,7 +212,7 @@ int hilite_attribute = A_REVERSE;
char
*
specified_color_combo
[]
=
{};
/* The color combinations as specified in the rcfile. */
#endif
color_pair
interface_color_pair
[]
=
{};
int
interface_color_pair
[]
=
{};
/* The processed color pairs for the interface elements. */
char
*
homedir
=
NULL
;
...
...
This diff is collapsed.
Click to expand it.
src/nano.c
View file @
960e848c
...
...
@@ -2506,10 +2506,10 @@ int main(int argc, char **argv)
#ifndef DISABLE_COLOR
set_colorpairs
();
#else
interface_color_pair
[
TITLE_BAR
]
.
pairnum
=
hilite_attribute
;
interface_color_pair
[
STATUS_BAR
]
.
pairnum
=
hilite_attribute
;
interface_color_pair
[
KEY_COMBO
]
.
pairnum
=
hilite_attribute
;
interface_color_pair
[
FUNCTION_TAG
]
.
pairnum
=
A_NORMAL
;
interface_color_pair
[
TITLE_BAR
]
=
hilite_attribute
;
interface_color_pair
[
STATUS_BAR
]
=
hilite_attribute
;
interface_color_pair
[
KEY_COMBO
]
=
hilite_attribute
;
interface_color_pair
[
FUNCTION_TAG
]
=
A_NORMAL
;
#endif
#if !defined(NANO_TINY) && defined(HAVE_KEY_DEFINED)
...
...
This diff is collapsed.
Click to expand it.
src/nano.h
View file @
960e848c
...
...
@@ -199,12 +199,6 @@ typedef enum {
}
undo_type
;
/* Structure types. */
typedef
struct
color_pair
{
int
pairnum
;
/* The color pair number used for this foreground color and
* background color. */
}
color_pair
;
#ifndef DISABLE_COLOR
typedef
struct
colortype
{
short
fg
;
...
...
This diff is collapsed.
Click to expand it.
src/prompt.c
View file @
960e848c
...
...
@@ -491,7 +491,7 @@ void update_the_statusbar(void)
index
=
strnlenpt
(
answer
,
statusbar_x
);
page_start
=
get_statusbar_page_start
(
start_col
,
start_col
+
index
);
wattron
(
bottomwin
,
interface_color_pair
[
TITLE_BAR
]
.
pairnum
);
wattron
(
bottomwin
,
interface_color_pair
[
TITLE_BAR
]);
blank_statusbar
();
...
...
@@ -503,7 +503,7 @@ void update_the_statusbar(void)
waddstr
(
bottomwin
,
expanded
);
free
(
expanded
);
wattroff
(
bottomwin
,
interface_color_pair
[
TITLE_BAR
]
.
pairnum
);
wattroff
(
bottomwin
,
interface_color_pair
[
TITLE_BAR
]);
statusbar_pww
=
statusbar_xplustabs
();
reset_statusbar_cursor
();
...
...
@@ -852,12 +852,12 @@ int do_yesno_prompt(bool all, const char *msg)
onekey
(
"^C"
,
_
(
"Cancel"
),
width
);
}
wattron
(
bottomwin
,
interface_color_pair
[
TITLE_BAR
]
.
pairnum
);
wattron
(
bottomwin
,
interface_color_pair
[
TITLE_BAR
]);
blank_statusbar
();
mvwaddnstr
(
bottomwin
,
0
,
0
,
msg
,
actual_x
(
msg
,
COLS
-
1
));
wattroff
(
bottomwin
,
interface_color_pair
[
TITLE_BAR
]
.
pairnum
);
wattroff
(
bottomwin
,
interface_color_pair
[
TITLE_BAR
]);
/* Refresh edit window and statusbar before getting input. */
wnoutrefresh
(
edit
);
...
...
This diff is collapsed.
Click to expand it.
src/proto.h
View file @
960e848c
...
...
@@ -142,7 +142,7 @@ extern int hilite_attribute;
#ifndef DISABLE_COLOR
extern
char
*
specified_color_combo
[
NUMBER_OF_ELEMENTS
];
#endif
extern
color_pair
interface_color_pair
[
NUMBER_OF_ELEMENTS
];
extern
int
interface_color_pair
[
NUMBER_OF_ELEMENTS
];
extern
char
*
homedir
;
...
...
This diff is collapsed.
Click to expand it.
src/winio.c
View file @
960e848c
...
...
@@ -1868,7 +1868,7 @@ void titlebar(const char *path)
assert
(
path
!=
NULL
||
openfile
->
filename
!=
NULL
);
wattron
(
topwin
,
interface_color_pair
[
TITLE_BAR
]
.
pairnum
);
wattron
(
topwin
,
interface_color_pair
[
TITLE_BAR
]);
blank_titlebar
();
...
...
@@ -1955,7 +1955,7 @@ void titlebar(const char *path)
else
if
(
statelen
>
0
)
mvwaddnstr
(
topwin
,
0
,
0
,
state
,
actual_x
(
state
,
COLS
));
wattroff
(
topwin
,
interface_color_pair
[
TITLE_BAR
]
.
pairnum
);
wattroff
(
topwin
,
interface_color_pair
[
TITLE_BAR
]);
wnoutrefresh
(
topwin
);
reset_cursor
();
...
...
@@ -2024,12 +2024,12 @@ void statusline(message_type importance, const char *msg, ...)
start_x
=
(
COLS
-
strlenpt
(
foo
)
-
4
)
/
2
;
wmove
(
bottomwin
,
0
,
start_x
);
wattron
(
bottomwin
,
interface_color_pair
[
STATUS_BAR
]
.
pairnum
);
wattron
(
bottomwin
,
interface_color_pair
[
STATUS_BAR
]);
waddstr
(
bottomwin
,
"[ "
);
waddstr
(
bottomwin
,
foo
);
free
(
foo
);
waddstr
(
bottomwin
,
" ]"
);
wattroff
(
bottomwin
,
interface_color_pair
[
STATUS_BAR
]
.
pairnum
);
wattroff
(
bottomwin
,
interface_color_pair
[
STATUS_BAR
]);
/* Push the message to the screen straightaway. */
wnoutrefresh
(
bottomwin
);
...
...
@@ -2126,17 +2126,17 @@ void onekey(const char *keystroke, const char *desc, int length)
{
assert
(
keystroke
!=
NULL
&&
desc
!=
NULL
);
wattron
(
bottomwin
,
interface_color_pair
[
KEY_COMBO
]
.
pairnum
);
wattron
(
bottomwin
,
interface_color_pair
[
KEY_COMBO
]);
waddnstr
(
bottomwin
,
keystroke
,
actual_x
(
keystroke
,
length
));
wattroff
(
bottomwin
,
interface_color_pair
[
KEY_COMBO
]
.
pairnum
);
wattroff
(
bottomwin
,
interface_color_pair
[
KEY_COMBO
]);
length
-=
strlenpt
(
keystroke
)
+
1
;
if
(
length
>
0
)
{
waddch
(
bottomwin
,
' '
);
wattron
(
bottomwin
,
interface_color_pair
[
FUNCTION_TAG
]
.
pairnum
);
wattron
(
bottomwin
,
interface_color_pair
[
FUNCTION_TAG
]);
waddnstr
(
bottomwin
,
desc
,
actual_x
(
desc
,
length
));
wattroff
(
bottomwin
,
interface_color_pair
[
FUNCTION_TAG
]
.
pairnum
);
wattroff
(
bottomwin
,
interface_color_pair
[
FUNCTION_TAG
]);
}
}
...
...
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