fix(tui): add isHome, isEnd, isDelete helpers for Kitty protocol
Extended the Kitty protocol parser to handle functional keys with ~ terminator (Delete, Insert, PageUp, PageDown) and Home/End keys. Updated editor.ts and input.ts to use the new helpers.
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
isCtrlK,
|
||||
isCtrlU,
|
||||
isCtrlW,
|
||||
isDelete,
|
||||
isEnter,
|
||||
} from "../keys.js";
|
||||
import type { Component } from "../tui.js";
|
||||
@@ -118,7 +119,7 @@ export class Input implements Component {
|
||||
return;
|
||||
}
|
||||
|
||||
if (data === "\x1b[3~") {
|
||||
if (isDelete(data)) {
|
||||
// Delete - delete grapheme at cursor (handles emojis, etc.)
|
||||
if (this.cursor < this.value.length) {
|
||||
const afterCursor = this.value.slice(this.cursor);
|
||||
|
||||
Reference in New Issue
Block a user