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
9a522dda
Commit
9a522dda
authored
May 28, 2015
by
stijn
Committed by
Paul Sokolovsky
May 30, 2015
Browse files
lib/mp-readline: Add implementation for deleting a character
xterm and others use the ESC[~3 sequence when pressing the delete key
parent
100004ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/mp-readline/readline.c
View file @
9a522dda
...
...
@@ -228,6 +228,12 @@ home_key:
}
else
if
(
rl
.
escape_seq_buf
[
0
]
==
'4'
||
rl
.
escape_seq_buf
[
0
]
==
'8'
)
{
end_key:
redraw_step_forward
=
rl
.
line
->
len
-
rl
.
cursor_pos
;
}
else
if
(
rl
.
escape_seq_buf
[
0
]
==
'3'
)
{
// delete
if
(
rl
.
cursor_pos
>=
rl
.
orig_line_len
&&
rl
.
cursor_pos
<
rl
.
line
->
len
)
{
vstr_cut_out_bytes
(
rl
.
line
,
rl
.
cursor_pos
,
1
);
redraw_from_cursor
=
true
;
}
}
else
{
DEBUG_printf
(
"(ESC [ %c %d)"
,
rl
.
escape_seq_buf
[
0
],
c
);
}
...
...
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