mirror of
https://github.com/nadrad/h-m-m.git
synced 2024-06-07 03:42:13 +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 =
|
$title =
|
||||||
mb_substr($title, 0, $from + ($from>0) )
|
mb_substr($title, 0, $from + ($from>0) )
|
||||||
.mb_substr($title, $cursor-1);
|
.mb_substr($title, $cursor-1)
|
||||||
|
;
|
||||||
$cursor = $from+1+($from>0);
|
$cursor = $from+1+($from>0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1194,8 +1195,25 @@ function magic_readline(&$mm, $title)
|
||||||
// ctrl+delete
|
// ctrl+delete
|
||||||
elseif ($in=="\033\133\63\073\065\176")
|
elseif ($in=="\033\133\63\073\065\176")
|
||||||
{
|
{
|
||||||
$title = '';
|
$len = mb_strlen($title);
|
||||||
$cursor = 1;
|
$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
|
// delete
|
||||||
|
|
Loading…
Reference in a new issue