mirror of
https://github.com/nadrad/h-m-m.git
synced 2024-05-17 22:46:32 +02:00
fixed ctrl+delete in the editor
This commit is contained in:
parent
8116d7ad4b
commit
b655e0e928
24
h-m-m
24
h-m-m
|
@ -1166,7 +1166,8 @@ function magic_readline(&$mm, $title)
|
|||
;
|
||||
$title =
|
||||
mb_substr($title, 0, $from + ($from>0) )
|
||||
.mb_substr($title, $cursor-1);
|
||||
.mb_substr($title, $cursor-1)
|
||||
;
|
||||
$cursor = $from+1+($from>0);
|
||||
}
|
||||
|
||||
|
@ -1194,8 +1195,25 @@ function magic_readline(&$mm, $title)
|
|||
// ctrl+delete
|
||||
elseif ($in=="\033\133\63\073\065\176")
|
||||
{
|
||||
$title = '';
|
||||
$cursor = 1;
|
||||
$len = mb_strlen($title);
|
||||
$from =
|
||||
mb_strpos
|
||||
(
|
||||
$title
|
||||
,' '
|
||||
,min
|
||||
(
|
||||
$cursor+1
|
||||
,$len
|
||||
)
|
||||
)
|
||||
;
|
||||
if ($from===false)
|
||||
$from=$len;
|
||||
$title =
|
||||
mb_substr($title, 0, $cursor-1)
|
||||
.mb_substr($title, $from+1 )
|
||||
;
|
||||
}
|
||||
|
||||
// delete
|
||||
|
|
Loading…
Reference in a new issue