mirror of
https://github.com/nadrad/h-m-m.git
synced 2024-06-07 03:42:13 +02:00
fixed ctrl+bs in the beginning of lines
This commit is contained in:
parent
e4ef78bbf9
commit
ab1f4d5ba1
3
h-m-m
3
h-m-m
|
@ -1148,8 +1148,7 @@ function magic_readline(&$mm, $title)
|
||||||
// ctrl+backspace
|
// ctrl+backspace
|
||||||
elseif ($in=="\010")
|
elseif ($in=="\010")
|
||||||
{
|
{
|
||||||
$from = mb_strrpos($title, ' ', min(1,$cursor-mb_strlen($title)-3));
|
$from = max(0, mb_strrpos($title, ' ', max(0,min(1,$cursor-mb_strlen($title)-3))));
|
||||||
if ($from === false) $from=1;
|
|
||||||
$title = mb_substr($title, 0, $from) . mb_substr($title,$cursor-1);
|
$title = mb_substr($title, 0, $from) . mb_substr($title,$cursor-1);
|
||||||
$cursor = $from+1;
|
$cursor = $from+1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue