Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
69dee59c
Commit
69dee59c
authored
Apr 02, 2014
by
Damien George
Browse files
stmhal: Add backspace key to readline (along with delete key).
parent
10e21b97
Changes
1
Hide whitespace changes
Inline
Side-by-side
stmhal/readline.c
View file @
69dee59c
...
...
@@ -58,8 +58,8 @@ int readline(vstr_t *line, const char *prompt) {
}
else
if
(
c
==
27
)
{
// escape sequence
escape_seq
=
1
;
}
else
if
(
c
==
127
)
{
// backspace
}
else
if
(
c
==
8
||
c
==
127
)
{
// backspace
/delete
if
(
cursor_pos
>
orig_line_len
)
{
vstr_cut_out_bytes
(
line
,
cursor_pos
-
1
,
1
);
// set redraw parameters
...
...
@@ -125,6 +125,7 @@ int readline(vstr_t *line, const char *prompt) {
}
// redraw command prompt, efficiently
// TODO we can probably use some more sophisticated VT100 commands here
if
(
redraw_step_back
>
0
)
{
for
(
int
i
=
0
;
i
<
redraw_step_back
;
i
++
)
{
stdout_tx_str
(
"
\b
"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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