mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-20 15:25:50 +00:00
chore: 移除 Cursor.ts 中未引用的 kill ring 访问器
- 删除 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 <zai-org@claude-code-best.win>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user