♻️ Refactor search

This commit is contained in:
2025-12-08 23:20:37 +08:00
parent 281f53c049
commit 3660d13d7d
42 changed files with 1003 additions and 1953 deletions

View File

@@ -16,13 +16,8 @@ type KeyBindingCommand string
const (
// 搜索扩展相关
ShowSearchCommand KeyBindingCommand = "showSearch" // 显示搜索
HideSearchCommand KeyBindingCommand = "hideSearch" // 隐藏搜索
SearchToggleCaseCommand KeyBindingCommand = "searchToggleCase" // 搜索切换大小写
SearchToggleWordCommand KeyBindingCommand = "searchToggleWord" // 搜索切换整词
SearchToggleRegexCommand KeyBindingCommand = "searchToggleRegex" // 搜索切换正则
SearchShowReplaceCommand KeyBindingCommand = "searchShowReplace" // 显示替换
SearchReplaceAllCommand KeyBindingCommand = "searchReplaceAll" // 替换全部
ShowSearchCommand KeyBindingCommand = "showSearch" // 显示搜索
HideSearchCommand KeyBindingCommand = "hideSearch" // 隐藏搜索
// 代码块扩展相关
BlockSelectAllCommand KeyBindingCommand = "blockSelectAll" // 块内选择全部
@@ -78,9 +73,6 @@ const (
HistoryRedoCommand KeyBindingCommand = "historyRedo" // 重做
HistoryUndoSelectionCommand KeyBindingCommand = "historyUndoSelection" // 撤销选择
HistoryRedoSelectionCommand KeyBindingCommand = "historyRedoSelection" // 重做选择
// 文本高亮扩展相关
TextHighlightToggleCommand KeyBindingCommand = "textHighlightToggle" // 切换文本高亮
)
// KeyBindingMetadata 快捷键配置元数据
@@ -124,41 +116,6 @@ func NewDefaultKeyBindings() []KeyBinding {
Enabled: true,
IsDefault: true,
},
{
Command: SearchToggleCaseCommand,
Extension: ExtensionSearch,
Key: "Alt-c",
Enabled: true,
IsDefault: true,
},
{
Command: SearchToggleWordCommand,
Extension: ExtensionSearch,
Key: "Alt-w",
Enabled: true,
IsDefault: true,
},
{
Command: SearchToggleRegexCommand,
Extension: ExtensionSearch,
Key: "Alt-r",
Enabled: true,
IsDefault: true,
},
{
Command: SearchShowReplaceCommand,
Extension: ExtensionSearch,
Key: "Mod-h",
Enabled: true,
IsDefault: true,
},
{
Command: SearchReplaceAllCommand,
Extension: ExtensionSearch,
Key: "Mod-Alt-Enter",
Enabled: true,
IsDefault: true,
},
// 代码块核心功能快捷键
{
@@ -496,15 +453,6 @@ func NewDefaultKeyBindings() []KeyBinding {
Enabled: true,
IsDefault: true,
},
// 文本高亮扩展快捷键
{
Command: TextHighlightToggleCommand,
Extension: ExtensionTextHighlight,
Key: "Mod-Shift-h",
Enabled: true,
IsDefault: true,
},
}
}