🐛 Fixed the issue of text highlighting expansion
This commit is contained in:
@@ -25,8 +25,7 @@ const (
|
||||
ExtensionMinimap ExtensionID = "minimap" // 小地图
|
||||
|
||||
// 工具扩展
|
||||
ExtensionSearch ExtensionID = "search" // 搜索功能
|
||||
ExtensionCodeBlock ExtensionID = "codeBlock" // 代码块
|
||||
ExtensionSearch ExtensionID = "search" // 搜索功能
|
||||
|
||||
// 核心扩展
|
||||
ExtensionEditor ExtensionID = "editor" // 编辑器核心功能
|
||||
@@ -90,7 +89,10 @@ func NewDefaultExtensions() []Extension {
|
||||
ID: ExtensionTextHighlight,
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
Config: ExtensionConfig{},
|
||||
Config: ExtensionConfig{
|
||||
"backgroundColor": "#FFD700",
|
||||
"opacity": 0.3,
|
||||
},
|
||||
},
|
||||
|
||||
// UI增强扩展
|
||||
@@ -112,15 +114,6 @@ func NewDefaultExtensions() []Extension {
|
||||
IsDefault: true,
|
||||
Config: ExtensionConfig{},
|
||||
},
|
||||
{
|
||||
ID: ExtensionCodeBlock,
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
Config: ExtensionConfig{
|
||||
"showBackground": true,
|
||||
"enableAutoDetection": true,
|
||||
},
|
||||
},
|
||||
|
||||
// 核心扩展
|
||||
{
|
||||
|
@@ -78,6 +78,9 @@ const (
|
||||
HistoryRedoCommand KeyBindingCommand = "historyRedo" // 重做
|
||||
HistoryUndoSelectionCommand KeyBindingCommand = "historyUndoSelection" // 撤销选择
|
||||
HistoryRedoSelectionCommand KeyBindingCommand = "historyRedoSelection" // 重做选择
|
||||
|
||||
// 文本高亮扩展相关
|
||||
TextHighlightToggleCommand KeyBindingCommand = "textHighlightToggle" // 切换文本高亮
|
||||
)
|
||||
|
||||
// KeyBindingMetadata 快捷键配置元数据
|
||||
@@ -157,115 +160,115 @@ func NewDefaultKeyBindings() []KeyBinding {
|
||||
IsDefault: true,
|
||||
},
|
||||
|
||||
// 代码块扩展快捷键
|
||||
// 代码块核心功能快捷键
|
||||
{
|
||||
Command: BlockSelectAllCommand,
|
||||
Extension: ExtensionCodeBlock,
|
||||
Extension: ExtensionEditor,
|
||||
Key: "Mod-a",
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
},
|
||||
{
|
||||
Command: BlockAddAfterCurrentCommand,
|
||||
Extension: ExtensionCodeBlock,
|
||||
Extension: ExtensionEditor,
|
||||
Key: "Mod-Enter",
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
},
|
||||
{
|
||||
Command: BlockAddAfterLastCommand,
|
||||
Extension: ExtensionCodeBlock,
|
||||
Extension: ExtensionEditor,
|
||||
Key: "Mod-Shift-Enter",
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
},
|
||||
{
|
||||
Command: BlockAddBeforeCurrentCommand,
|
||||
Extension: ExtensionCodeBlock,
|
||||
Extension: ExtensionEditor,
|
||||
Key: "Alt-Enter",
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
},
|
||||
{
|
||||
Command: BlockGotoPreviousCommand,
|
||||
Extension: ExtensionCodeBlock,
|
||||
Extension: ExtensionEditor,
|
||||
Key: "Mod-ArrowUp",
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
},
|
||||
{
|
||||
Command: BlockGotoNextCommand,
|
||||
Extension: ExtensionCodeBlock,
|
||||
Extension: ExtensionEditor,
|
||||
Key: "Mod-ArrowDown",
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
},
|
||||
{
|
||||
Command: BlockSelectPreviousCommand,
|
||||
Extension: ExtensionCodeBlock,
|
||||
Extension: ExtensionEditor,
|
||||
Key: "Mod-Shift-ArrowUp",
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
},
|
||||
{
|
||||
Command: BlockSelectNextCommand,
|
||||
Extension: ExtensionCodeBlock,
|
||||
Extension: ExtensionEditor,
|
||||
Key: "Mod-Shift-ArrowDown",
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
},
|
||||
{
|
||||
Command: BlockDeleteCommand,
|
||||
Extension: ExtensionCodeBlock,
|
||||
Extension: ExtensionEditor,
|
||||
Key: "Mod-Shift-d",
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
},
|
||||
{
|
||||
Command: BlockMoveUpCommand,
|
||||
Extension: ExtensionCodeBlock,
|
||||
Extension: ExtensionEditor,
|
||||
Key: "Alt-Mod-ArrowUp",
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
},
|
||||
{
|
||||
Command: BlockMoveDownCommand,
|
||||
Extension: ExtensionCodeBlock,
|
||||
Extension: ExtensionEditor,
|
||||
Key: "Alt-Mod-ArrowDown",
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
},
|
||||
{
|
||||
Command: BlockDeleteLineCommand,
|
||||
Extension: ExtensionCodeBlock,
|
||||
Extension: ExtensionEditor,
|
||||
Key: "Mod-Shift-k",
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
},
|
||||
{
|
||||
Command: BlockMoveLineUpCommand,
|
||||
Extension: ExtensionCodeBlock,
|
||||
Extension: ExtensionEditor,
|
||||
Key: "Alt-ArrowUp",
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
},
|
||||
{
|
||||
Command: BlockMoveLineDownCommand,
|
||||
Extension: ExtensionCodeBlock,
|
||||
Extension: ExtensionEditor,
|
||||
Key: "Alt-ArrowDown",
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
},
|
||||
{
|
||||
Command: BlockTransposeCharsCommand,
|
||||
Extension: ExtensionCodeBlock,
|
||||
Extension: ExtensionEditor,
|
||||
Key: "Ctrl-t",
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
},
|
||||
{
|
||||
Command: BlockFormatCommand,
|
||||
Extension: ExtensionCodeBlock,
|
||||
Extension: ExtensionEditor,
|
||||
Key: "Mod-Shift-f",
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
@@ -493,6 +496,15 @@ func NewDefaultKeyBindings() []KeyBinding {
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
},
|
||||
|
||||
// 文本高亮扩展快捷键
|
||||
{
|
||||
Command: TextHighlightToggleCommand,
|
||||
Extension: ExtensionTextHighlight,
|
||||
Key: "Mod-Shift-h",
|
||||
Enabled: true,
|
||||
IsDefault: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user