@lvce-editor/quick-pick-worker 4.23.0 → 4.23.1
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/quickPickWorkerMain.js +15 -4
- package/package.json +1 -1
|
@@ -4094,11 +4094,20 @@ const getLoadedState = async state => {
|
|
|
4094
4094
|
platform
|
|
4095
4095
|
});
|
|
4096
4096
|
array(newPicks);
|
|
4097
|
+
let colorTheme = '';
|
|
4098
|
+
if (subId === ColorTheme$1) {
|
|
4099
|
+
try {
|
|
4100
|
+
colorTheme = await invoke$3('ColorTheme.getColorTheme');
|
|
4101
|
+
} catch {
|
|
4102
|
+
// The worker can be released before the renderer endpoint.
|
|
4103
|
+
}
|
|
4104
|
+
}
|
|
4097
4105
|
const filterValue = getFilterValue(id, subId, value);
|
|
4098
4106
|
const items = isTextInput(args) ? newPicks : filterQuickPickItems(newPicks, filterValue, subId === Commands$1);
|
|
4099
|
-
const
|
|
4100
|
-
const
|
|
4101
|
-
const
|
|
4107
|
+
const focusedIndex = subId === ColorTheme$1 ? Math.max(items.findIndex(item => item.label === colorTheme), 0) : 0;
|
|
4108
|
+
const minLineY = Math.max(Math.min(focusedIndex - maxVisibleItems + 1, items.length - maxVisibleItems), 0);
|
|
4109
|
+
const maxLineY = Math.min(minLineY + maxVisibleItems, items.length);
|
|
4110
|
+
const sliced = items.slice(minLineY, maxLineY);
|
|
4102
4111
|
const {
|
|
4103
4112
|
icons,
|
|
4104
4113
|
newFileIconCache
|
|
@@ -4111,10 +4120,11 @@ const getLoadedState = async state => {
|
|
|
4111
4120
|
...state,
|
|
4112
4121
|
args,
|
|
4113
4122
|
cursorOffset: value.length,
|
|
4123
|
+
deltaY: minLineY * itemHeight,
|
|
4114
4124
|
fileIconCache: newFileIconCache,
|
|
4115
4125
|
finalDeltaY,
|
|
4116
4126
|
focused: true,
|
|
4117
|
-
focusedIndex
|
|
4127
|
+
focusedIndex,
|
|
4118
4128
|
icons,
|
|
4119
4129
|
initial: false,
|
|
4120
4130
|
inputSource: Script,
|
|
@@ -4139,6 +4149,7 @@ const loadContentWithContext = async context => {
|
|
|
4139
4149
|
await context.updateState(latestState => ({
|
|
4140
4150
|
...latestState,
|
|
4141
4151
|
cursorOffset: loadedState.cursorOffset,
|
|
4152
|
+
deltaY: loadedState.deltaY,
|
|
4142
4153
|
fileIconCache: loadedState.fileIconCache,
|
|
4143
4154
|
finalDeltaY: loadedState.finalDeltaY,
|
|
4144
4155
|
focused: loadedState.focused,
|