fix(tui): scope file autocomplete to session (#33458)
This commit is contained in:
parent
975b1132f1
commit
ef2357915e
6 changed files with 70 additions and 49 deletions
|
|
@ -80,7 +80,8 @@ import { usePluginRuntime } from "../../plugin/runtime"
|
|||
import { DialogRetryAction } from "../../component/dialog-retry-action"
|
||||
import { getRevertDiffFiles } from "../../util/revert-diff"
|
||||
import { OPENCODE_BASE_MODE, useBindings, useCommandShortcut, useOpencodeKeymap } from "../../keymap"
|
||||
import { PathFormatterProvider, usePathFormatter } from "../../context/path-format"
|
||||
import { usePathFormatter } from "../../context/path-format"
|
||||
import { LocationProvider } from "../../context/location"
|
||||
|
||||
addDefaultParsers(parsers.parsers)
|
||||
|
||||
|
|
@ -193,6 +194,10 @@ export function Session() {
|
|||
const { theme } = useTheme()
|
||||
const promptRef = usePromptRef()
|
||||
const session = createMemo(() => sync.session.get(route.sessionID))
|
||||
const location = createMemo(() => {
|
||||
const current = session()
|
||||
return current ? { directory: current.directory, workspaceID: current.workspaceID } : undefined
|
||||
})
|
||||
|
||||
createEffect(() => {
|
||||
const title = Locale.truncate(session()?.title ?? "", 50)
|
||||
|
|
@ -1138,7 +1143,7 @@ export function Session() {
|
|||
createEffect(on(() => route.sessionID, toBottom))
|
||||
|
||||
return (
|
||||
<PathFormatterProvider path={session()?.directory}>
|
||||
<LocationProvider location={location()}>
|
||||
<context.Provider
|
||||
value={{
|
||||
get width() {
|
||||
|
|
@ -1338,7 +1343,7 @@ export function Session() {
|
|||
</Show>
|
||||
</box>
|
||||
</context.Provider>
|
||||
</PathFormatterProvider>
|
||||
</LocationProvider>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue