* dev

* Improve sync design

* Support buffer local mapping

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* stylua

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* integration

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* update

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp
This commit is contained in:
hrsh7th
2021-08-04 01:07:12 +09:00
committed by GitHub
parent b32a6e7e77
commit d23d3533cf
53 changed files with 4681 additions and 0 deletions

31
lua/cmp/context_spec.lua Normal file
View File

@@ -0,0 +1,31 @@
local spec = require('cmp.utils.spec')
local context = require('cmp.context')
describe('context', function()
before_each(spec.before)
describe('new', function()
it('middle of text', function()
vim.fn.setline('1', 'function! s:name() abort')
vim.bo.filetype = 'vim'
vim.fn.execute('normal! fm')
local ctx = context.new()
assert.are.equal(ctx.filetype, 'vim')
assert.are.equal(ctx.cursor.row, 1)
assert.are.equal(ctx.cursor.col, 15)
assert.are.equal(ctx.cursor_line, 'function! s:name() abort')
end)
it('tab indent', function()
vim.fn.setline('1', '\t\tab')
vim.bo.filetype = 'vim'
vim.fn.execute('normal! fb')
local ctx = context.new()
assert.are.equal(ctx.filetype, 'vim')
assert.are.equal(ctx.cursor.row, 1)
assert.are.equal(ctx.cursor.col, 4)
assert.are.equal(ctx.cursor_line, '\t\tab')
end)
end)
end)