mirror of
https://github.com/nadrad/h-m-m.git
synced 2024-06-27 06:40:02 +02:00
fixed ctrl+backspace bug
This commit is contained in:
parent
c870e3b098
commit
8116d7ad4b
23
h-m-m
23
h-m-m
|
@ -1148,9 +1148,26 @@ function magic_readline(&$mm, $title)
|
||||||
// ctrl+backspace
|
// ctrl+backspace
|
||||||
elseif ($in=="\010")
|
elseif ($in=="\010")
|
||||||
{
|
{
|
||||||
$from = max(0, mb_strrpos($title, ' ', max(0,min(1,$cursor-mb_strlen($title)-3))));
|
$from =
|
||||||
$title = mb_substr($title, 0, $from) . mb_substr($title,$cursor-1);
|
max
|
||||||
$cursor = $from+1;
|
(
|
||||||
|
0
|
||||||
|
,mb_strrpos
|
||||||
|
(
|
||||||
|
$title
|
||||||
|
,' '
|
||||||
|
,max
|
||||||
|
(
|
||||||
|
-mb_strlen($title)
|
||||||
|
,$cursor-mb_strlen($title)-3
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
;
|
||||||
|
$title =
|
||||||
|
mb_substr($title, 0, $from + ($from>0) )
|
||||||
|
.mb_substr($title, $cursor-1);
|
||||||
|
$cursor = $from+1+($from>0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// backspace
|
// backspace
|
||||||
|
|
Loading…
Reference in a new issue