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
031305c2
Commit
031305c2
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: strip some debugging stuff, and condense a bit of code
parent
e2843ede
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
+16
-30
src/winio.c
with
16 additions
and
30 deletions
+16
-30
src/winio.c
View file @
031305c2
...
...
@@ -360,11 +360,6 @@ int get_kbinput(WINDOW *win, bool showcursor)
while
(
kbinput
==
ERR
)
kbinput
=
parse_kbinput
(
win
);
#ifdef DEBUG
fprintf
(
stderr
,
"after parsing: kbinput = %d, meta_key = %s
\n
"
,
kbinput
,
meta_key
?
"TRUE"
:
"FALSE"
);
#endif
/* If we read from the edit window, blank the statusbar if needed. */
if
(
win
==
edit
)
check_statusblank
();
...
...
@@ -1277,39 +1272,30 @@ int arrow_from_abcd(int kbinput)
* isn't empty, and that the initial escape has already been read in. */
int
parse_escape_sequence
(
WINDOW
*
win
,
int
kbinput
)
{
int
retval
,
*
seq
;
size_t
seq_len
;
int
retval
,
*
sequence
,
length
;
/* Put back the non-escape character, get the complete escape
* sequence, translate the sequence into its corresponding key
* value, and save that as the result. */
unget_input
(
&
kbinput
,
1
);
seq_len
=
key_buffer_len
;
seq
=
get_input
(
NULL
,
seq_len
);
retval
=
convert_sequence
(
seq
,
seq_len
);
free
(
seq
);
length
=
key_buffer_len
;
sequence
=
get_input
(
NULL
,
length
);
retval
=
convert_sequence
(
sequence
,
length
);
free
(
sequence
);
/* If we got an unrecognized escape sequence, notify the user. */
if
(
retval
==
ERR
)
{
if
(
win
==
edit
)
{
/* TRANSLATORS: This refers to a sequence of escape codes
* (from the keyboard) that nano does not know about. */
statusline
(
ALERT
,
_
(
"Unknown sequence"
));
suppress_cursorpos
=
FALSE
;
lastmessage
=
HUSH
;
if
(
currmenu
==
MMAIN
)
{
place_the_cursor
();
curs_set
(
1
);
}
if
(
retval
==
ERR
&&
win
==
edit
)
{
/* TRANSLATORS: This refers to a sequence of escape codes
* (from the keyboard) that nano does not recogize. */
statusline
(
ALERT
,
_
(
"Unknown sequence"
));
suppress_cursorpos
=
FALSE
;
lastmessage
=
HUSH
;
if
(
currmenu
==
MMAIN
)
{
place_the_cursor
();
curs_set
(
1
);
}
}
#ifdef DEBUG
fprintf
(
stderr
,
"parse_escape_sequence(): kbinput = %d, seq_len = %lu, retval = %d
\n
"
,
kbinput
,
(
unsigned
long
)
seq_len
,
retval
);
#endif
return
retval
;
}
...
...
@@ -1774,7 +1760,7 @@ const sc *get_shortcut(int *kbinput)
sc
*
s
;
#ifdef DEBUG
fprintf
(
stderr
,
"
get_shortcut()
: kbinput = %d, meta_key = %s -- "
,
fprintf
(
stderr
,
"
after parsing
: kbinput = %d, meta_key = %s -- "
,
*
kbinput
,
meta_key
?
"TRUE"
:
"FALSE"
);
#endif
...
...
@@ -1788,10 +1774,10 @@ const sc *get_shortcut(int *kbinput)
return
s
;
}
}
#ifdef DEBUG
fprintf
(
stderr
,
"matched nothing
\n
"
);
#endif
return
NULL
;
}
...
...
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