fixed ctrl+bs in the beginning of lines

This commit is contained in:
nadrad 2022-09-23 11:02:32 +02:00
parent e4ef78bbf9
commit ab1f4d5ba1

3
h-m-m
View file

@ -1148,8 +1148,7 @@ function magic_readline(&$mm, $title)
// ctrl+backspace
elseif ($in=="\010")
{
$from = mb_strrpos($title, ' ', min(1,$cursor-mb_strlen($title)-3));
if ($from === false) $from=1;
$from = max(0, mb_strrpos($title, ' ', max(0,min(1,$cursor-mb_strlen($title)-3))));
$title = mb_substr($title, 0, $from) . mb_substr($title,$cursor-1);
$cursor = $from+1;
}