Merge pull request #13590 from NousResearch/bb/tui-enter-applies-path-completion

fix(tui): apply path/@ completion on Enter
This commit is contained in:
brooklyn! 2026-04-21 15:50:43 -05:00 committed by GitHub
commit c0db4d529d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -234,11 +234,11 @@ export function useSubmission(opts: UseSubmissionOptions) {
const submit = useCallback(
(value: string) => {
if (value.startsWith('/') && composerState.completions.length) {
if (composerState.completions.length) {
const row = composerState.completions[composerState.compIdx]
if (row?.text) {
const text = row.text.startsWith('/') && composerState.compReplace > 0 ? row.text.slice(1) : row.text
const text = value.startsWith('/') && row.text.startsWith('/') ? row.text.slice(1) : row.text
const next = value.slice(0, composerState.compReplace) + text
if (next !== value) {