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
6807e06a
Commit
6807e06a
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: frob a few comments, and elide and #ifndef
parent
84cd0abd
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/nano.c
+8
-15
src/nano.c
with
8 additions
and
15 deletions
+8
-15
src/nano.c
View file @
6807e06a
...
...
@@ -1172,7 +1172,7 @@ void stdin_pager(void)
finish_stdin_pager
();
}
/*
Initialize the
signal handlers. */
/*
Register half a dozen
signal handlers. */
void
signal_init
(
void
)
{
/* Trap SIGINT and SIGQUIT because we want them to do useful things. */
...
...
@@ -1196,12 +1196,12 @@ void signal_init(void)
sigaction
(
SIGWINCH
,
&
act
,
NULL
);
#endif
/* Trap a normal suspend (^Z) so we can handle it ourselves. */
if
(
ISSET
(
SUSPEND
))
{
/* Block all other signals in the suspend and continue handlers.
* If we don't do this, other stuff interrupts them! */
sigfillset
(
&
act
.
sa_mask
);
#ifdef SIGTSTP
/* Trap a normal suspend (^Z) so we can handle it ourselves. */
act
.
sa_handler
=
do_suspend
;
sigaction
(
SIGTSTP
,
&
act
,
NULL
);
#endif
...
...
@@ -1247,7 +1247,7 @@ RETSIGTYPE do_suspend(int signal)
#endif
}
/*
The version of above function that is bound to a key
. */
/*
Put nano to sleep (if suspension is enabled)
. */
void
do_suspend_void
(
void
)
{
if
(
ISSET
(
SUSPEND
))
...
...
@@ -1270,7 +1270,7 @@ RETSIGTYPE do_continue(int signal)
/* Perhaps the user resized the window while we slept. */
the_window_resized
=
TRUE
;
#else
/*
Restore the state of the terminal
. */
/*
Put the terminal in the desired state again
. */
terminal_init
();
#endif
/* Tickle the input routine so it will update the screen. */
...
...
@@ -1326,21 +1326,16 @@ void regenerate_screen(void)
SLsmg_reset_smg
();
SLsmg_init_smg
();
#else
/* Do the equivalent of what Minimum Profit does:
L
eave and
*
immediately
reenter curses mode. */
/* Do the equivalent of what Minimum Profit does:
l
eave and
immediately
* reenter curses mode. */
endwin
();
doupdate
();
#endif
/* Restore the terminal to its previous state. */
/* Put the terminal in the desired state again, recreate the subwindows
* with their (new) sizes, and redraw the contents of these windows. */
terminal_init
();
/* Do the equivalent of what both mutt and Minimum Profit do:
* Reinitialize all the windows based on the new screen
* dimensions. */
window_init
();
/* Redraw the contents of the windows that need it. */
total_refresh
();
}
...
...
@@ -1354,9 +1349,7 @@ void allow_sigwinch(bool allow)
sigaddset
(
&
winch
,
SIGWINCH
);
sigprocmask
(
allow
?
SIG_UNBLOCK
:
SIG_BLOCK
,
&
winch
,
NULL
);
}
#endif
/* !NANO_TINY */
#ifndef NANO_TINY
/* Handle the global toggle specified in flag. */
void
do_toggle
(
int
flag
)
{
...
...
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