MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / FocusWindow

Function FocusWindow

pkg/wcore/window.go:194–209  ·  view source on GitHub ↗
(ctx context.Context, windowId string)

Source from the content-addressed store, hash-verified

192}
193
194func FocusWindow(ctx context.Context, windowId string) error {
195 log.Printf("FocusWindow %s\n", windowId)
196 client, err := GetClientData(ctx)
197 if err != nil {
198 log.Printf("error getting client data: %v\n", err)
199 return err
200 }
201 winIdx := utilfn.SliceIdx(client.WindowIds, windowId)
202 if winIdx == -1 {
203 log.Printf("window %s not found in client data\n", windowId)
204 return nil
205 }
206 client.WindowIds = utilfn.MoveSliceIdxToFront(client.WindowIds, winIdx)
207 log.Printf("client.WindowIds: %v\n", client.WindowIds)
208 return wstore.DBUpdate(ctx, client)
209}

Callers 1

FocusWindowMethod · 0.92

Calls 4

SliceIdxFunction · 0.92
MoveSliceIdxToFrontFunction · 0.92
DBUpdateFunction · 0.92
GetClientDataFunction · 0.85

Tested by

no test coverage detected