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
a878f5f1
Commit
a878f5f1
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
screen: catch a window resize also when the keyboard is in nodelay mode
This fixes
https://savannah.gnu.org/bugs/?47954
.
parent
5cbaf590
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/winio.c
+18
-5
src/winio.c
with
18 additions
and
5 deletions
+18
-5
src/winio.c
View file @
a878f5f1
...
...
@@ -42,7 +42,18 @@ static bool seen_wide = FALSE;
/* Whether we've seen a multicolumn character in the current line. */
#ifndef NANO_TINY
static
sig_atomic_t
sigwinch_counter_save
=
0
;
static
sig_atomic_t
last_sigwinch_counter
=
0
;
/* Did we receive a SIGWINCH since we were last called? */
bool
the_window_resized
(
void
)
{
if
(
sigwinch_counter
==
last_sigwinch_counter
)
return
FALSE
;
last_sigwinch_counter
=
sigwinch_counter
;
regenerate_screen
();
return
TRUE
;
}
#endif
/* Control character compatibility:
...
...
@@ -123,6 +134,11 @@ void get_key_buffer(WINDOW *win)
/* Read in the first character using whatever mode we're in. */
input
=
wgetch
(
win
);
#ifndef NANO_TINY
if
(
the_window_resized
())
input
=
KEY_WINCH
;
#endif
if
(
input
==
ERR
&&
nodelay_mode
)
return
;
...
...
@@ -135,10 +151,7 @@ void get_key_buffer(WINDOW *win)
handle_hupterm
(
0
);
#ifndef NANO_TINY
/* Did we get a SIGWINCH since we were last here? */
if
(
sigwinch_counter
!=
sigwinch_counter_save
)
{
sigwinch_counter_save
=
sigwinch_counter
;
regenerate_screen
();
if
(
the_window_resized
())
{
input
=
KEY_WINCH
;
break
;
}
...
...
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