mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-13 19:45:12 +00:00
Merge pull request #12701 from overleaf/dk-cm6-autocomplete-item-space
[cm6] Add space after item autocomplete GitOrigin-RevId: 6fff77c0c0563530af981bbac73b1d88e02bb759
This commit is contained in:
parent
4341abcf64
commit
462837b44d
4 changed files with 50 additions and 28 deletions
|
@ -1415,13 +1415,13 @@ module.exports = {
|
|||
},
|
||||
{
|
||||
caption: '\\item',
|
||||
snippet: '\\item',
|
||||
snippet: '\\item ',
|
||||
meta: 'hyperref-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
{
|
||||
caption: '\\item[]',
|
||||
snippet: '\\item[$1]',
|
||||
snippet: '\\item[$1] ',
|
||||
meta: 'hyperref-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
|
@ -4663,13 +4663,13 @@ module.exports = {
|
|||
},
|
||||
{
|
||||
caption: '\\item',
|
||||
snippet: '\\item',
|
||||
snippet: '\\item ',
|
||||
meta: 'biblatex-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
{
|
||||
caption: '\\item[]',
|
||||
snippet: '\\item[$1]',
|
||||
snippet: '\\item[$1] ',
|
||||
meta: 'biblatex-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
|
@ -17551,13 +17551,13 @@ module.exports = {
|
|||
},
|
||||
{
|
||||
caption: '\\item',
|
||||
snippet: '\\item',
|
||||
snippet: '\\item ',
|
||||
meta: 'threeparttable-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
{
|
||||
caption: '\\item[]',
|
||||
snippet: '\\item[$1]',
|
||||
snippet: '\\item[$1] ',
|
||||
meta: 'threeparttable-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
|
@ -25309,13 +25309,13 @@ module.exports = {
|
|||
},
|
||||
{
|
||||
caption: '\\item',
|
||||
snippet: '\\item',
|
||||
snippet: '\\item ',
|
||||
meta: 'bibentry-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
{
|
||||
caption: '\\item[]',
|
||||
snippet: '\\item[$1]',
|
||||
snippet: '\\item[$1] ',
|
||||
meta: 'bibentry-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
|
@ -27225,13 +27225,13 @@ module.exports = {
|
|||
},
|
||||
{
|
||||
caption: '\\item',
|
||||
snippet: '\\item',
|
||||
snippet: '\\item ',
|
||||
meta: 'bookmark-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
{
|
||||
caption: '\\item[]',
|
||||
snippet: '\\item[$1]',
|
||||
snippet: '\\item[$1] ',
|
||||
meta: 'bookmark-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
|
@ -33919,13 +33919,13 @@ module.exports = {
|
|||
},
|
||||
{
|
||||
caption: '\\item',
|
||||
snippet: '\\item',
|
||||
snippet: '\\item ',
|
||||
meta: 'eqparbox-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
{
|
||||
caption: '\\item[]',
|
||||
snippet: '\\item[$1]',
|
||||
snippet: '\\item[$1] ',
|
||||
meta: 'eqparbox-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
|
@ -34081,13 +34081,13 @@ module.exports = {
|
|||
threeparttablex: [
|
||||
{
|
||||
caption: '\\item',
|
||||
snippet: '\\item',
|
||||
snippet: '\\item ',
|
||||
meta: 'threeparttablex-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
{
|
||||
caption: '\\item[]',
|
||||
snippet: '\\item[$1]',
|
||||
snippet: '\\item[$1] ',
|
||||
meta: 'threeparttablex-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
|
@ -34117,13 +34117,13 @@ module.exports = {
|
|||
},
|
||||
{
|
||||
caption: '\\item',
|
||||
snippet: '\\item',
|
||||
snippet: '\\item ',
|
||||
meta: 'threeparttablex-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
{
|
||||
caption: '\\item[]',
|
||||
snippet: '\\item[$1]',
|
||||
snippet: '\\item[$1] ',
|
||||
meta: 'threeparttablex-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
|
@ -51721,13 +51721,13 @@ module.exports = {
|
|||
},
|
||||
{
|
||||
caption: '\\item',
|
||||
snippet: '\\item',
|
||||
snippet: '\\item ',
|
||||
meta: 'eqlist-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
{
|
||||
caption: '\\item[]',
|
||||
snippet: '\\item[$1]',
|
||||
snippet: '\\item[$1] ',
|
||||
meta: 'eqlist-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
|
@ -56523,13 +56523,13 @@ module.exports = {
|
|||
},
|
||||
{
|
||||
caption: '\\item',
|
||||
snippet: '\\item',
|
||||
snippet: '\\item ',
|
||||
meta: 'hypdvips-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
{
|
||||
caption: '\\item[]',
|
||||
snippet: '\\item[$1]',
|
||||
snippet: '\\item[$1] ',
|
||||
meta: 'hypdvips-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
|
@ -59797,13 +59797,13 @@ module.exports = {
|
|||
},
|
||||
{
|
||||
caption: '\\item',
|
||||
snippet: '\\item',
|
||||
snippet: '\\item ',
|
||||
meta: 'attachfile-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
{
|
||||
caption: '\\item[]',
|
||||
snippet: '\\item[$1]',
|
||||
snippet: '\\item[$1] ',
|
||||
meta: 'attachfile-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
|
@ -70319,13 +70319,13 @@ module.exports = {
|
|||
},
|
||||
{
|
||||
caption: '\\item',
|
||||
snippet: '\\item',
|
||||
snippet: '\\item ',
|
||||
meta: 'aurl-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
{
|
||||
caption: '\\item[]',
|
||||
snippet: '\\item[$1]',
|
||||
snippet: '\\item[$1] ',
|
||||
meta: 'aurl-cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
|
|
|
@ -19,13 +19,13 @@ export default [
|
|||
},
|
||||
{
|
||||
caption: '\\item',
|
||||
snippet: '\\item',
|
||||
snippet: '\\item ',
|
||||
meta: 'cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
{
|
||||
caption: '\\item[]',
|
||||
snippet: '\\item[$1]',
|
||||
snippet: '\\item[$1] ',
|
||||
meta: 'cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
|
|
|
@ -26,13 +26,13 @@ export default [
|
|||
},
|
||||
{
|
||||
caption: '\\item',
|
||||
snippet: '\\item',
|
||||
snippet: '\\item ',
|
||||
meta: 'cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
{
|
||||
caption: '\\item[]',
|
||||
snippet: '\\item[$1]',
|
||||
snippet: '\\item[$1] ',
|
||||
meta: 'cmd',
|
||||
score: 3.800886892251021,
|
||||
},
|
||||
|
|
|
@ -283,4 +283,26 @@ describe('<CodeMirrorEditor/> lists in Rich Text mode', function () {
|
|||
expect(win.getSelection()?.toString()).to.equal('Two')
|
||||
})
|
||||
})
|
||||
|
||||
it('uses autocomplete to create an list item', function () {
|
||||
const content = [
|
||||
'\\begin{itemize}',
|
||||
'\\item first',
|
||||
'',
|
||||
'\\end{itemize}',
|
||||
].join('\n')
|
||||
mountEditor(content)
|
||||
|
||||
cy.get('.cm-line')
|
||||
.eq(2)
|
||||
.click()
|
||||
.type('\\ite')
|
||||
.type('{enter}')
|
||||
.type('second')
|
||||
|
||||
cy.get('.cm-content').should(
|
||||
'have.text',
|
||||
['\\begin{itemize}', ' first', ' second', '\\end{itemize}'].join('')
|
||||
)
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue