@lvce-editor/editor-worker 19.48.0 → 19.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editorWorkerMain.js +19 -5
- package/dist/settings.json +8 -0
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -5040,6 +5040,7 @@ const createEditor2 = (id, uri, x, y, width, height, platform, assetDir) => {
|
|
|
5040
5040
|
handleOffsetX: 0,
|
|
5041
5041
|
hasListener: false,
|
|
5042
5042
|
height,
|
|
5043
|
+
highlightActiveLineNumber: true,
|
|
5043
5044
|
highlightedLine: -1,
|
|
5044
5045
|
hoverEnabled: false,
|
|
5045
5046
|
id,
|
|
@@ -5275,6 +5276,7 @@ const createEditor = async ({
|
|
|
5275
5276
|
fontWeight,
|
|
5276
5277
|
formatOnSave,
|
|
5277
5278
|
height,
|
|
5279
|
+
highlightActiveLineNumber = true,
|
|
5278
5280
|
hoverEnabled,
|
|
5279
5281
|
id,
|
|
5280
5282
|
isAutoClosingBracketsEnabled,
|
|
@@ -5338,6 +5340,7 @@ const createEditor = async ({
|
|
|
5338
5340
|
handleOffsetX: 0,
|
|
5339
5341
|
hasListener: false,
|
|
5340
5342
|
height,
|
|
5343
|
+
highlightActiveLineNumber,
|
|
5341
5344
|
id,
|
|
5342
5345
|
incrementalEdits: emptyIncrementalEdits,
|
|
5343
5346
|
insertSpaces: true,
|
|
@@ -5532,7 +5535,7 @@ const isEqual$3 = (oldState, newState) => {
|
|
|
5532
5535
|
};
|
|
5533
5536
|
|
|
5534
5537
|
const isEqual$2 = (oldState, newState) => {
|
|
5535
|
-
return oldState.breadcrumbsEnabled === newState.breadcrumbsEnabled && oldState.breakPoints === newState.breakPoints && oldState.bracketMatchInfos === newState.bracketMatchInfos && oldState.cursorInfos === newState.cursorInfos && oldState.diagnostics === newState.diagnostics && oldState.documentSymbols === newState.documentSymbols && oldState.endOfLineDecorations === newState.endOfLineDecorations && oldState.focused === newState.focused && oldState.gutterDecorations === newState.gutterDecorations && oldState.highlightedLine === newState.highlightedLine && oldState.lineNumbers === newState.lineNumbers && oldState.loadError === newState.loadError && oldState.textInfos === newState.textInfos && oldState.differences === newState.differences && oldState.initial === newState.initial && oldState.selectionInfos === newState.selectionInfos && oldState.selections === newState.selections && oldState.workspaceUri === newState.workspaceUri;
|
|
5538
|
+
return oldState.breadcrumbsEnabled === newState.breadcrumbsEnabled && oldState.breakPoints === newState.breakPoints && oldState.bracketMatchInfos === newState.bracketMatchInfos && oldState.cursorInfos === newState.cursorInfos && oldState.diagnostics === newState.diagnostics && oldState.documentSymbols === newState.documentSymbols && oldState.endOfLineDecorations === newState.endOfLineDecorations && oldState.focused === newState.focused && oldState.gutterDecorations === newState.gutterDecorations && oldState.highlightActiveLineNumber === newState.highlightActiveLineNumber && oldState.highlightedLine === newState.highlightedLine && oldState.lineNumbers === newState.lineNumbers && oldState.loadError === newState.loadError && oldState.textInfos === newState.textInfos && oldState.differences === newState.differences && oldState.initial === newState.initial && oldState.selectionInfos === newState.selectionInfos && oldState.selections === newState.selections && oldState.workspaceUri === newState.workspaceUri;
|
|
5536
5539
|
};
|
|
5537
5540
|
|
|
5538
5541
|
const isEqual$1 = (oldState, newState) => {
|
|
@@ -13686,6 +13689,7 @@ const kLetterSpacing = 'editor.letterSpacing';
|
|
|
13686
13689
|
const kTabSize = 'editor.tabSize';
|
|
13687
13690
|
const kInsertSpaces = 'editor.insertSpaces';
|
|
13688
13691
|
const kLineNumbers = 'editor.lineNumbers';
|
|
13692
|
+
const kHighlightActiveLineNumber = 'editor.highlightActiveLineNumber';
|
|
13689
13693
|
const kDiagnostics = 'editor.diagnostics';
|
|
13690
13694
|
const kQuickSuggestions = 'editor.quickSuggestions';
|
|
13691
13695
|
const kAutoClosingQuotes = 'editor.autoClosingQuotes';
|
|
@@ -13737,6 +13741,9 @@ const getInsertSpaces = async () => {
|
|
|
13737
13741
|
const getLineNumbers = async () => {
|
|
13738
13742
|
return (await get$3(kLineNumbers)) ?? false;
|
|
13739
13743
|
};
|
|
13744
|
+
const getHighlightActiveLineNumber = async () => {
|
|
13745
|
+
return (await get$3(kHighlightActiveLineNumber)) ?? true;
|
|
13746
|
+
};
|
|
13740
13747
|
const getCompletionTriggerCharacters = async () => {
|
|
13741
13748
|
return ['.', '/'];
|
|
13742
13749
|
};
|
|
@@ -13754,7 +13761,7 @@ const getBreadcrumbsEnabled = async () => {
|
|
|
13754
13761
|
};
|
|
13755
13762
|
|
|
13756
13763
|
const getEditorPreferences = async () => {
|
|
13757
|
-
const [diagnosticsEnabled$1, fontFamily, fontSize, fontWeight, hoverEnabled, isAutoClosingBracketsEnabled$1, isAutoClosingQuotesEnabled$1, isAutoClosingTagsEnabled$1, isQuickSuggestionsEnabled$1, lineNumbers, rowHeight, tabSize, letterSpacing, completionTriggerCharacters, minimapEnabled, breadcrumbsEnabled, insertSpaces, dragAndDropEnabled] = await Promise.all([diagnosticsEnabled(), getFontFamily(), getFontSize(), getFontWeight(), getHoverEnabled(), isAutoClosingBracketsEnabled(), isAutoClosingQuotesEnabled(), isAutoClosingTagsEnabled(), isQuickSuggestionsEnabled(), getLineNumbers(), getRowHeight(), getTabSize(), getLetterSpacing(), getCompletionTriggerCharacters(), getMinimapEnabled(), getBreadcrumbsEnabled(), getInsertSpaces(), getDragAndDropEnabled()]);
|
|
13764
|
+
const [diagnosticsEnabled$1, fontFamily, fontSize, fontWeight, hoverEnabled, isAutoClosingBracketsEnabled$1, isAutoClosingQuotesEnabled$1, isAutoClosingTagsEnabled$1, isQuickSuggestionsEnabled$1, lineNumbers, highlightActiveLineNumber, rowHeight, tabSize, letterSpacing, completionTriggerCharacters, minimapEnabled, breadcrumbsEnabled, insertSpaces, dragAndDropEnabled] = await Promise.all([diagnosticsEnabled(), getFontFamily(), getFontSize(), getFontWeight(), getHoverEnabled(), isAutoClosingBracketsEnabled(), isAutoClosingQuotesEnabled(), isAutoClosingTagsEnabled(), isQuickSuggestionsEnabled(), getLineNumbers(), getHighlightActiveLineNumber(), getRowHeight(), getTabSize(), getLetterSpacing(), getCompletionTriggerCharacters(), getMinimapEnabled(), getBreadcrumbsEnabled(), getInsertSpaces(), getDragAndDropEnabled()]);
|
|
13758
13765
|
return {
|
|
13759
13766
|
breadcrumbsEnabled,
|
|
13760
13767
|
completionTriggerCharacters,
|
|
@@ -13763,6 +13770,7 @@ const getEditorPreferences = async () => {
|
|
|
13763
13770
|
fontFamily,
|
|
13764
13771
|
fontSize,
|
|
13765
13772
|
fontWeight,
|
|
13773
|
+
highlightActiveLineNumber,
|
|
13766
13774
|
hoverEnabled,
|
|
13767
13775
|
insertSpaces,
|
|
13768
13776
|
isAutoClosingBracketsEnabled: isAutoClosingBracketsEnabled$1,
|
|
@@ -14103,6 +14111,7 @@ const loadContent = async (state, savedState) => {
|
|
|
14103
14111
|
fontFamily,
|
|
14104
14112
|
fontSize,
|
|
14105
14113
|
fontWeight,
|
|
14114
|
+
highlightActiveLineNumber,
|
|
14106
14115
|
hoverEnabled,
|
|
14107
14116
|
insertSpaces,
|
|
14108
14117
|
isAutoClosingBracketsEnabled,
|
|
@@ -14135,6 +14144,7 @@ const loadContent = async (state, savedState) => {
|
|
|
14135
14144
|
fontFamily,
|
|
14136
14145
|
fontSize,
|
|
14137
14146
|
fontWeight,
|
|
14147
|
+
highlightActiveLineNumber,
|
|
14138
14148
|
hoverEnabled,
|
|
14139
14149
|
insertSpaces,
|
|
14140
14150
|
isAutoClosingBracketsEnabled,
|
|
@@ -15200,6 +15210,7 @@ const getEditorVirtualDom = ({
|
|
|
15200
15210
|
focused = true,
|
|
15201
15211
|
gutterDecorations = [],
|
|
15202
15212
|
gutterInfos = [],
|
|
15213
|
+
highlightActiveLineNumber = true,
|
|
15203
15214
|
highlightedLine = -1,
|
|
15204
15215
|
lightBulbRowIndex = -1,
|
|
15205
15216
|
lineNumbers = true,
|
|
@@ -15231,7 +15242,8 @@ const getEditorVirtualDom = ({
|
|
|
15231
15242
|
const visibleGutterInfos = breakPoints.length > 0 || gutterDecorations.length > 0 || visibleLineIndices ? getGutterInfos(minLineY, maxLineY, breakPoints, lineNumbers, visibleLineIndices, lightBulbRowIndex, gutterDecorations) : gutterInfos;
|
|
15232
15243
|
const showGutter = lineNumbers || breakPoints.length > 0 || lightBulbRowIndex >= 0 || gutterDecorations.length > 0;
|
|
15233
15244
|
const primaryCursorRowIndex = getPrimaryCursorRowIndex(selections, primarySelectionIndex);
|
|
15234
|
-
const
|
|
15245
|
+
const activeLineNumber = highlightActiveLineNumber ? primaryCursorRowIndex + 1 : -1;
|
|
15246
|
+
const gutterDom = showGutter ? getEditorGutterVirtualDom(visibleGutterInfos, activeLineNumber) : [];
|
|
15235
15247
|
const minimapDom = getMinimapVirtualDom(minimapEnabled, minimapLines, minLineY);
|
|
15236
15248
|
const breadcrumbsDom = breadcrumbsEnabled ? getEditorBreadcrumbsVirtualDom({
|
|
15237
15249
|
breadcrumbsEnabled,
|
|
@@ -15497,6 +15509,7 @@ const renderGutterInfo = {
|
|
|
15497
15509
|
const {
|
|
15498
15510
|
breakPoints,
|
|
15499
15511
|
gutterDecorations,
|
|
15512
|
+
highlightActiveLineNumber,
|
|
15500
15513
|
lightBulbRowIndex,
|
|
15501
15514
|
lineNumbers,
|
|
15502
15515
|
maxLineY,
|
|
@@ -15510,10 +15523,11 @@ const renderGutterInfo = {
|
|
|
15510
15523
|
}
|
|
15511
15524
|
const gutterInfos = getGutterInfos(minLineY, maxLineY, breakPoints, lineNumbers, visibleLineIndices, lightBulbRowIndex, gutterDecorations);
|
|
15512
15525
|
const primaryCursorRowIndex = getPrimaryCursorRowIndex(selections, primarySelectionIndex);
|
|
15513
|
-
const
|
|
15526
|
+
const activeLineNumber = highlightActiveLineNumber ? primaryCursorRowIndex + 1 : -1;
|
|
15527
|
+
const dom = getEditorGutterVirtualDom$1(gutterInfos, activeLineNumber);
|
|
15514
15528
|
return ['renderGutter', dom];
|
|
15515
15529
|
},
|
|
15516
|
-
isEqual: (oldState, newState) => oldState.breakPoints === newState.breakPoints && oldState.gutterDecorations === newState.gutterDecorations && oldState.lightBulbRowIndex === newState.lightBulbRowIndex && oldState.foldingRanges === newState.foldingRanges && oldState.lineNumbers === newState.lineNumbers && oldState.minLineY === newState.minLineY && oldState.maxLineY === newState.maxLineY && getPrimaryCursorRowIndex(oldState.selections, oldState.primarySelectionIndex) === getPrimaryCursorRowIndex(newState.selections, newState.primarySelectionIndex)
|
|
15530
|
+
isEqual: (oldState, newState) => oldState.breakPoints === newState.breakPoints && oldState.gutterDecorations === newState.gutterDecorations && oldState.lightBulbRowIndex === newState.lightBulbRowIndex && oldState.foldingRanges === newState.foldingRanges && oldState.highlightActiveLineNumber === newState.highlightActiveLineNumber && oldState.lineNumbers === newState.lineNumbers && oldState.minLineY === newState.minLineY && oldState.maxLineY === newState.maxLineY && (!newState.highlightActiveLineNumber || getPrimaryCursorRowIndex(oldState.selections, oldState.primarySelectionIndex) === getPrimaryCursorRowIndex(newState.selections, newState.primarySelectionIndex))
|
|
15517
15531
|
};
|
|
15518
15532
|
const renderWidgets = {
|
|
15519
15533
|
apply: renderWidgets$1,
|
package/dist/settings.json
CHANGED
|
@@ -53,6 +53,14 @@
|
|
|
53
53
|
"type": 1,
|
|
54
54
|
"value": "on"
|
|
55
55
|
},
|
|
56
|
+
{
|
|
57
|
+
"category": "text-editor",
|
|
58
|
+
"description": "Controls whether the primary cursor line number is highlighted",
|
|
59
|
+
"heading": "Highlight Active Line Number",
|
|
60
|
+
"id": "editor.highlightActiveLineNumber",
|
|
61
|
+
"type": 3,
|
|
62
|
+
"value": true
|
|
63
|
+
},
|
|
56
64
|
{
|
|
57
65
|
"category": "text-editor",
|
|
58
66
|
"description": "Controls whether the minimap is shown",
|