Skip to content

Commit 179c579

Browse files
lambdalisueclaude
andcommitted
fix: make session saving asynchronous to improve picker close performance
Remove await from savePickerSession call in defer block to prevent blocking picker close. Session save now happens in background with error handling. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 2c66097 commit 179c579

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

denops/fall/main/picker.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,18 @@ async function startPicker<T extends Detail>(
212212
stack.defer(() => {
213213
zindex -= Picker.ZINDEX_ALLOCATION;
214214
});
215-
stack.defer(async () => {
215+
stack.defer(() => {
216216
const name = pickerParams.name;
217217
if (SESSION_EXCLUDE_SOURCES.includes(name)) {
218218
return;
219219
}
220-
await savePickerSession({
220+
// Save session asynchronously without blocking picker close
221+
savePickerSession({
221222
name,
222223
args,
223224
context: itemPicker.context,
225+
}).catch((error) => {
226+
console.error(`Failed to save picker session: ${error}`);
224227
});
225228
});
226229

0 commit comments

Comments
 (0)