Only exclude the current command from autocompletion (#14367)

GitOrigin-RevId: 1f1dc0f2c3bcd19b12e06ec56d2d82181b0b5c6d
This commit is contained in:
Alf Eaton
2023-08-18 08:05:09 +00:00
committed by Copybot
parent fbb0ab210e
commit 06aa92d0fd
2 changed files with 23 additions and 4 deletions
@@ -1064,4 +1064,23 @@ describe('autocomplete', { scrollBehavior: false }, function () {
cy.findAllByRole('option').contains('sometext.txt').click()
activeEditorLine().should('have.text', '\\input{sometext.txt}')
})
it('excludes the current command from completions', function () {
const scope = mockScope(mockDocContent(''))
cy.mount(
<Container>
<EditorProviders scope={scope}>
<CodeMirrorEditor />
</EditorProviders>
</Container>
)
cy.get('.cm-line').eq(21).type('\\fff \\ff')
cy.findAllByRole('listbox').should('have.length', 1)
cy.findAllByRole('option').contains('\\fff').click()
cy.get('.cm-line').eq(21).should('have.text', '\\fff \\fff')
})
})