fix cmd+L bug

This commit is contained in:
Nate 2024-11-12 13:43:10 -08:00
parent a2af40e141
commit 41dc2f02ef
3 changed files with 20 additions and 1 deletions

View file

@ -15,6 +15,10 @@ export class ContinueGUIWebviewViewProvider
public static readonly viewType = "continue.continueGUIView";
public webviewProtocol: VsCodeWebviewProtocol;
public get isReady(): boolean {
return !!this.webview;
}
private updateDebugLogsStatus() {
const settings = vscode.workspace.getConfiguration(EXTENSION_NAME);
this.enableDebugLogs = settings.get<boolean>("enableDebugLogs", false);

View file

@ -366,6 +366,14 @@ const commandsMap: (
core.invoke("context/indexDocs", { reIndex: true });
},
"continue.focusContinueInput": async () => {
// This is a temporary fix—sidebar.webviewProtocol.request is blocking
// when the GUI hasn't yet been setup and we should instead be
// immediately throwing an error, or returning a Result object
if (!sidebar.isReady) {
focusGUI();
return;
}
const historyLength = await sidebar.webviewProtocol.request(
"getWebviewHistoryLength",
undefined,
@ -388,6 +396,14 @@ const commandsMap: (
}
},
"continue.focusContinueInputWithoutClear": async () => {
// This is a temporary fix—sidebar.webviewProtocol.request is blocking
// when the GUI hasn't yet been setup and we should instead be
// immediately throwing an error, or returning a Result object
if (!sidebar.isReady) {
focusGUI();
return;
}
const isContinueInputFocused = await sidebar.webviewProtocol.request(
"isContinueInputFocused",
undefined,

View file

@ -109,7 +109,6 @@ export function parseColorForHex(colorVar: string): string {
colorVar,
);
if (value.startsWith("#")) {
console.log("OAIJFIOJOOJOIO", colorVar, value, value.slice(0, 7));
return value.slice(0, 7);
}