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
a7c158d0
Commit
a7c158d0
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
input: simplify a bit of code, reducing a four-case switch to a single if
parent
97e9849d
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
+4
-13
src/winio.c
with
4 additions
and
13 deletions
+4
-13
src/winio.c
View file @
a7c158d0
...
...
@@ -346,19 +346,10 @@ int parse_kbinput(WINDOW *win)
case
NANO_CONTROL_3
:
/* Increment the escape counter. */
escapes
++
;
switch
(
escapes
)
{
case
1
:
/* One escape: wait for more input. */
case
2
:
/* Two escapes: wait for more input. */
case
3
:
/* Three escapes: wait for more input. */
break
;
default:
/* More than three escapes: limit the escape counter
* to no more than two, and wait for more input. */
escapes
%=
3
;
}
/* If there are four consecutive escapes, discard three of them. */
if
(
escapes
>
3
)
escapes
=
1
;
/* Wait for more input. */
break
;
default:
switch
(
escapes
)
{
...
...
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