Skip to content

Commit

Permalink
fix(tests): use defaultRange for nested snippets
Browse files Browse the repository at this point in the history
Closes #4807

Looks like nvim 0.10 changed something will move cursor after snippet session. Use the defaultRange as workaround to make nested tests work.
  • Loading branch information
fannheyward committed Feb 22, 2024
1 parent b14c1e9 commit aded3f9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/__tests__/snippets/session.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ describe('SnippetSession', () => {
expect(res).toBe(true)
let { placeholder } = session
expect(placeholder.index).toBe(1)
let r = await getCursorRange()
res = await session.start('${1:foo} ${2:bar}', r)
res = await session.start('${1:foo} ${2:bar}', defaultRange)
expect(res).toBe(true)
placeholder = session.placeholder
expect(placeholder.index).toBe(2)
Expand Down

0 comments on commit aded3f9

Please sign in to comment.