pi-input-history 1.1.1 → 1.1.3
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/index.ts +6 -1
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -100,7 +100,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
100
100
|
ctx.ui.setEditorComponent((tui, theme, keybindings) => {
|
|
101
101
|
const editor =
|
|
102
102
|
prevComponentFactory?.(tui, theme, keybindings) ??
|
|
103
|
-
new CustomEditor(tui, theme, keybindings);
|
|
103
|
+
new CustomEditor(tui, theme, keybindings, { embedWorkingStatus: true });
|
|
104
104
|
|
|
105
105
|
for (let i = items.length - 1; i >= 0; i--) {
|
|
106
106
|
editor.addToHistory?.(items[i]!);
|
|
@@ -120,12 +120,17 @@ export default function (pi: ExtensionAPI) {
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
let overlayTui: TUI | undefined;
|
|
123
124
|
const selected = await ctx.ui.custom<string | null>((tui, theme, _kb, done) => {
|
|
125
|
+
overlayTui = tui;
|
|
124
126
|
return new ReverseSearchComponent(tui, theme, merged, done, config);
|
|
125
127
|
}, { overlay: true, overlayOptions: { anchor: "bottom-center", width: "100%" } });
|
|
126
128
|
|
|
127
129
|
if (selected === null) return;
|
|
128
130
|
ctx.ui.setEditorText(selected);
|
|
131
|
+
// setEditorText does not repaint, and the render triggered by hiding the overlay
|
|
132
|
+
// runs before this continuation (nextTick queue drains before promise microtasks).
|
|
133
|
+
overlayTui?.requestRender();
|
|
129
134
|
},
|
|
130
135
|
});
|
|
131
136
|
}
|