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
4ad0490c
Commit
4ad0490c
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: rename a variable, for more contrast
parent
d85098ab
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
+24
-24
src/winio.c
with
24 additions
and
24 deletions
+24
-24
src/winio.c
View file @
4ad0490c
...
...
@@ -761,14 +761,14 @@ int parse_kbinput(WINDOW *win)
* keypad values, into their corresponding key values. These sequences
* are generated when the keypad doesn't support the needed keys.
* Assume that Escape has already been read in. */
int
convert_sequence
(
const
int
*
seq
,
size_t
seq_
len
)
int
convert_sequence
(
const
int
*
seq
,
size_t
len
gth
)
{
if
(
seq_
len
>
1
)
{
if
(
len
gth
>
1
)
{
switch
(
seq
[
0
])
{
case
'O'
:
switch
(
seq
[
1
])
{
case
'1'
:
if
(
seq_
len
>
4
&&
seq
[
2
]
==
';'
)
{
if
(
len
gth
>
4
&&
seq
[
2
]
==
';'
)
{
switch
(
seq
[
3
])
{
case
'2'
:
...
...
@@ -806,7 +806,7 @@ int convert_sequence(const int *seq, size_t seq_len)
}
break
;
case
'2'
:
if
(
seq_
len
>=
3
)
{
if
(
len
gth
>=
3
)
{
switch
(
seq
[
2
])
{
case
'P'
:
/* Esc O 2 P == F13 on xterm. */
return
KEY_F
(
13
);
...
...
@@ -820,7 +820,7 @@ int convert_sequence(const int *seq, size_t seq_len)
}
break
;
case
'5'
:
if
(
seq_
len
>=
3
)
{
if
(
len
gth
>=
3
)
{
switch
(
seq
[
2
])
{
case
'A'
:
/* Esc O 5 A == Ctrl-Up on Haiku. */
return
CONTROL_UP
;
...
...
@@ -933,7 +933,7 @@ int convert_sequence(const int *seq, size_t seq_len)
case
'['
:
switch
(
seq
[
1
])
{
case
'1'
:
if
(
seq_
len
>
3
&&
seq
[
3
]
==
'~'
)
{
if
(
len
gth
>
3
&&
seq
[
3
]
==
'~'
)
{
switch
(
seq
[
2
])
{
case
'1'
:
/* Esc [ 1 1 ~ == F1 on rxvt/Eterm. */
return
KEY_F
(
1
);
...
...
@@ -953,7 +953,7 @@ int convert_sequence(const int *seq, size_t seq_len)
case
'9'
:
/* Esc [ 1 9 ~ == F8 on the same. */
return
KEY_F
(
8
);
}
}
else
if
(
seq_
len
>
4
&&
seq
[
2
]
==
';'
)
{
}
else
if
(
len
gth
>
4
&&
seq
[
2
]
==
';'
)
{
switch
(
seq
[
3
])
{
case
'2'
:
...
...
@@ -1031,12 +1031,12 @@ int convert_sequence(const int *seq, size_t seq_len)
#endif
}
}
else
if
(
seq_
len
>
2
&&
seq
[
2
]
==
'~'
)
}
else
if
(
len
gth
>
2
&&
seq
[
2
]
==
'~'
)
/* Esc [ 1 ~ == Home on VT320/Linux console. */
return
KEY_HOME
;
break
;
case
'2'
:
if
(
seq_
len
>
3
&&
seq
[
3
]
==
'~'
)
{
if
(
len
gth
>
3
&&
seq
[
3
]
==
'~'
)
{
switch
(
seq
[
2
])
{
case
'0'
:
/* Esc [ 2 0 ~ == F9 on VT220/VT320/
* Linux console/xterm/rxvt/Eterm. */
...
...
@@ -1057,45 +1057,45 @@ int convert_sequence(const int *seq, size_t seq_len)
case
'9'
:
/* Esc [ 2 9 ~ == F16 on the same. */
return
KEY_F
(
16
);
}
}
else
if
(
seq_
len
>
2
&&
seq
[
2
]
==
'~'
)
}
else
if
(
len
gth
>
2
&&
seq
[
2
]
==
'~'
)
/* Esc [ 2 ~ == Insert on VT220/VT320/
* Linux console/xterm/Terminal. */
return
KEY_IC
;
break
;
case
'3'
:
/* Esc [ 3 ~ == Delete on VT220/VT320/
* Linux console/xterm/Terminal. */
if
(
seq_
len
>
2
&&
seq
[
2
]
==
'~'
)
if
(
len
gth
>
2
&&
seq
[
2
]
==
'~'
)
return
KEY_DC
;
break
;
case
'4'
:
/* Esc [ 4 ~ == End on VT220/VT320/
* Linux console/xterm. */
if
(
seq_
len
>
2
&&
seq
[
2
]
==
'~'
)
if
(
len
gth
>
2
&&
seq
[
2
]
==
'~'
)
return
KEY_END
;
break
;
case
'5'
:
/* Esc [ 5 ~ == PageUp on VT220/VT320/
* Linux console/xterm/Terminal;
* Esc [ 5 ^ == PageUp on Eterm. */
if
(
seq_
len
>
2
&&
(
seq
[
2
]
==
'~'
||
seq
[
2
]
==
'^'
))
if
(
len
gth
>
2
&&
(
seq
[
2
]
==
'~'
||
seq
[
2
]
==
'^'
))
return
KEY_PPAGE
;
break
;
case
'6'
:
/* Esc [ 6 ~ == PageDown on VT220/VT320/
* Linux console/xterm/Terminal;
* Esc [ 6 ^ == PageDown on Eterm. */
if
(
seq_
len
>
2
&&
(
seq
[
2
]
==
'~'
||
seq
[
2
]
==
'^'
))
if
(
len
gth
>
2
&&
(
seq
[
2
]
==
'~'
||
seq
[
2
]
==
'^'
))
return
KEY_NPAGE
;
break
;
case
'7'
:
/* Esc [ 7 ~ == Home on Eterm/rxvt;
* Esc [ 7 $ == Shift-Home on Eterm/rxvt;
* Esc [ 7 ^ == Control-Home on Eterm/rxvt;
* Esc [ 7 @ == Shift-Control-Home on same. */
if
(
seq_
len
>
2
&&
seq
[
2
]
==
'~'
)
if
(
len
gth
>
2
&&
seq
[
2
]
==
'~'
)
return
KEY_HOME
;
else
if
(
seq_
len
>
2
&&
seq
[
2
]
==
'$'
)
else
if
(
len
gth
>
2
&&
seq
[
2
]
==
'$'
)
return
SHIFT_HOME
;
else
if
(
seq_
len
>
2
&&
seq
[
2
]
==
'^'
)
else
if
(
len
gth
>
2
&&
seq
[
2
]
==
'^'
)
return
CONTROL_HOME
;
#ifndef NANO_TINY
else
if
(
seq_
len
>
2
&&
seq
[
2
]
==
'@'
)
else
if
(
len
gth
>
2
&&
seq
[
2
]
==
'@'
)
return
shiftcontrolhome
;
#endif
break
;
...
...
@@ -1103,14 +1103,14 @@ int convert_sequence(const int *seq, size_t seq_len)
* Esc [ 8 $ == Shift-End on Eterm/rxvt;
* Esc [ 8 ^ == Control-End on Eterm/rxvt;
* Esc [ 8 @ == Shift-Control-End on same. */
if
(
seq_
len
>
2
&&
seq
[
2
]
==
'~'
)
if
(
len
gth
>
2
&&
seq
[
2
]
==
'~'
)
return
KEY_END
;
else
if
(
seq_
len
>
2
&&
seq
[
2
]
==
'$'
)
else
if
(
len
gth
>
2
&&
seq
[
2
]
==
'$'
)
return
SHIFT_END
;
else
if
(
seq_
len
>
2
&&
seq
[
2
]
==
'^'
)
else
if
(
len
gth
>
2
&&
seq
[
2
]
==
'^'
)
return
CONTROL_END
;
#ifndef NANO_TINY
else
if
(
seq_
len
>
2
&&
seq
[
2
]
==
'@'
)
else
if
(
len
gth
>
2
&&
seq
[
2
]
==
'@'
)
return
shiftcontrolend
;
#endif
break
;
...
...
@@ -1143,7 +1143,7 @@ int convert_sequence(const int *seq, size_t seq_len)
case
'N'
:
/* Esc [ N == F2 on FreeBSD console. */
return
KEY_F
(
2
);
case
'O'
:
if
(
seq_
len
>
2
)
{
if
(
len
gth
>
2
)
{
switch
(
seq
[
2
])
{
case
'P'
:
/* Esc [ O P == F1 on xterm. */
return
KEY_F
(
1
);
...
...
@@ -1188,7 +1188,7 @@ int convert_sequence(const int *seq, size_t seq_len)
shift_held
=
TRUE
;
return
arrow_from_abcd
(
seq
[
1
]);
case
'['
:
if
(
seq_
len
>
2
)
{
if
(
len
gth
>
2
)
{
switch
(
seq
[
2
])
{
case
'A'
:
/* Esc [ [ A == F1 on Linux console. */
return
KEY_F
(
1
);
...
...
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