Add support for c-Left/c-Right

This commit is contained in:
2024-10-03 18:26:36 +02:00
parent ab399f77e9
commit e70839ee30
2 changed files with 17 additions and 0 deletions

View File

@@ -736,6 +736,17 @@ class Editor
if ($cursorPos < mb_strlen($value))
$cursorPos++;
break;
case "k{CLEFT}":
while ($cursorPos > 0) {
$cursorPos--;
if (mb_substr($value, $cursorPos - 1, 1) == " ") {
break;
}
}
break;
case "k{CRIGHT}":
$cursorPos = min(mb_strlen($value), (mb_strpos($value, " ", $cursorPos) ?: mb_strlen($value)) + 1);
break;
case "k{HOME}":
$cursorPos = 0;
break;