From 7ad33e5d464090aac7e71c65af7cda4414435ce5 Mon Sep 17 00:00:00 2001 From: claude-code-best Date: Sat, 20 Jun 2026 10:21:46 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=A7=BB=E9=99=A4=20Cursor.ts=20?= =?UTF-8?q?=E4=B8=AD=E6=9C=AA=E5=BC=95=E7=94=A8=E7=9A=84=20kill=20ring=20?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除 getKillRingItem、getKillRingSize、clearKillRing、canYankPop(全仓零引用的独立 export) - 移除 VIM_WORD_CHAR_REGEX 的 export 关键字(仍由 isVimWordChar 内部使用,保留常量本体) kill ring 特性本身仍活跃(getLastKill/pushToKillRing/yankPop 在 useSearchInput/useTextInput 使用),仅这几个孤儿 helper 未接入。 Co-Authored-By: glm-5.2 --- src/utils/Cursor.ts | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/src/utils/Cursor.ts b/src/utils/Cursor.ts index 6968ff473..b656687e1 100644 --- a/src/utils/Cursor.ts +++ b/src/utils/Cursor.ts @@ -51,26 +51,6 @@ export function getLastKill(): string { return killRing[0] ?? '' } -export function getKillRingItem(index: number): string { - if (killRing.length === 0) return '' - const normalizedIndex = - ((index % killRing.length) + killRing.length) % killRing.length - return killRing[normalizedIndex] ?? '' -} - -export function getKillRingSize(): number { - return killRing.length -} - -export function clearKillRing(): void { - killRing = [] - killRingIndex = 0 - lastActionWasKill = false - lastActionWasYank = false - lastYankStart = 0 - lastYankLength = 0 -} - export function resetKillAccumulation(): void { lastActionWasKill = false } @@ -83,10 +63,6 @@ export function recordYank(start: number, length: number): void { killRingIndex = 0 } -export function canYankPop(): boolean { - return lastActionWasYank && killRing.length > 1 -} - export function yankPop(): { text: string start: number @@ -130,7 +106,7 @@ export function resetYankState(): void { */ // Pre-compiled regex patterns for Vim word detection (avoid creating in hot loops) -export const VIM_WORD_CHAR_REGEX = /^[\p{L}\p{N}\p{M}_]$/u +const VIM_WORD_CHAR_REGEX = /^[\p{L}\p{N}\p{M}_]$/u export const WHITESPACE_REGEX = /\s/ // Exported helper functions for Vim character classification