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
14637812
Commit
14637812
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
startup: when an rcfile contains errors, report this on the status bar
Suggested-by:
Brand Huntsman
<
alpha@qzx.com
>
parent
c3a11fb7
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/global.c
+2
-0
src/global.c
src/nano.c
+3
-0
src/nano.c
src/proto.h
+1
-0
src/proto.h
src/rcfile.c
+3
-0
src/rcfile.c
with
9 additions
and
0 deletions
+9
-0
src/global.c
View file @
14637812
...
...
@@ -242,6 +242,8 @@ int interface_color_pair[] = {0};
char
*
homedir
=
NULL
;
/* The user's home directory, from $HOME or /etc/passwd. */
char
*
rcfile_with_errors
=
NULL
;
/* The first nanorc file, if any, that produced warnings. */
/* Return the number of entries in the shortcut list for a given menu. */
...
...
This diff is collapsed.
Click to expand it.
src/nano.c
View file @
14637812
...
...
@@ -2594,6 +2594,9 @@ int main(int argc, char **argv)
prepare_for_display
();
if
(
rcfile_with_errors
!=
NULL
)
statusline
(
ALERT
,
_
(
"Mistakes in '%s'"
),
rcfile_with_errors
);
while
(
TRUE
)
{
#ifdef ENABLE_LINENUMBERS
int
needed_margin
=
digits
(
openfile
->
filebot
->
lineno
)
+
1
;
...
...
This diff is collapsed.
Click to expand it.
src/proto.h
View file @
14637812
...
...
@@ -181,6 +181,7 @@ extern char* specified_color_combo[NUMBER_OF_ELEMENTS];
extern
int
interface_color_pair
[
NUMBER_OF_ELEMENTS
];
extern
char
*
homedir
;
extern
char
*
rcfile_with_errors
;
typedef
void
(
*
functionptrtype
)(
void
);
...
...
This diff is collapsed.
Click to expand it.
src/rcfile.c
View file @
14637812
...
...
@@ -141,6 +141,9 @@ void rcfile_error(const char *msg, ...)
{
va_list
ap
;
if
(
rcfile_with_errors
==
NULL
)
rcfile_with_errors
=
strdup
(
nanorc
);
if
(
lineno
>
0
)
fprintf
(
stderr
,
_
(
"Error in %s on line %lu: "
),
nanorc
,
(
unsigned
long
)
lineno
);
...
...
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