ci: formatting
This commit is contained in:
parent
13c0ea1e92
commit
e5d9b4b7bd
9 changed files with 44 additions and 18 deletions
|
|
@ -1,6 +1,6 @@
|
|||
require('spec.helpers')
|
||||
local parser = require('diffs.parser')
|
||||
local highlight = require('diffs.highlight')
|
||||
local parser = require('diffs.parser')
|
||||
|
||||
local function create_buffer(lines)
|
||||
local bufnr = vim.api.nvim_create_buf(false, true)
|
||||
|
|
@ -34,7 +34,6 @@ local function highlight_opts()
|
|||
end
|
||||
|
||||
describe('parser email-quoted diffs', function()
|
||||
|
||||
it('parses a fully email-quoted unified diff', function()
|
||||
local bufnr = create_buffer({
|
||||
'> diff --git a/foo.py b/foo.py',
|
||||
|
|
|
|||
|
|
@ -419,8 +419,13 @@ describe('highlight', function()
|
|||
local last_body_row = hunk.start_line + #hunk.lines - 1
|
||||
vim.api.nvim_buf_clear_namespace(bufnr, ns, last_body_row + 1, last_body_row + 10)
|
||||
|
||||
local marks =
|
||||
vim.api.nvim_buf_get_extmarks(bufnr, ns, { last_body_row, 0 }, { last_body_row, -1 }, { details = true })
|
||||
local marks = vim.api.nvim_buf_get_extmarks(
|
||||
bufnr,
|
||||
ns,
|
||||
{ last_body_row, 0 },
|
||||
{ last_body_row, -1 },
|
||||
{ details = true }
|
||||
)
|
||||
local has_line_bg = false
|
||||
for _, mark in ipairs(marks) do
|
||||
if mark[4] and mark[4].line_hl_group == 'DiffsAdd' then
|
||||
|
|
@ -464,8 +469,13 @@ describe('highlight', function()
|
|||
local clear_end = hunk.start_line + #hunk.lines
|
||||
vim.api.nvim_buf_clear_namespace(bufnr, ns, clear_start, clear_end)
|
||||
|
||||
local marks =
|
||||
vim.api.nvim_buf_get_extmarks(bufnr, ns, { last_body_row, 0 }, { last_body_row, -1 }, { details = false })
|
||||
local marks = vim.api.nvim_buf_get_extmarks(
|
||||
bufnr,
|
||||
ns,
|
||||
{ last_body_row, 0 },
|
||||
{ last_body_row, -1 },
|
||||
{ details = false }
|
||||
)
|
||||
assert.are.equal(0, #marks)
|
||||
delete_buffer(bufnr)
|
||||
end)
|
||||
|
|
@ -849,7 +859,7 @@ describe('highlight', function()
|
|||
if d then
|
||||
if d.hl_group == 'DiffsClear' then
|
||||
table.insert(priorities.clear, d.priority)
|
||||
elseif (d.line_hl_group == 'DiffsAdd' or d.line_hl_group == 'DiffsDelete') then
|
||||
elseif d.line_hl_group == 'DiffsAdd' or d.line_hl_group == 'DiffsDelete' then
|
||||
table.insert(priorities.line_bg, d.priority)
|
||||
elseif d.hl_group == 'DiffsAddText' or d.hl_group == 'DiffsDeleteText' then
|
||||
table.insert(priorities.char_bg, d.priority)
|
||||
|
|
|
|||
|
|
@ -129,7 +129,9 @@ describe('integration', function()
|
|||
|
||||
describe('ft_retry_pending', function()
|
||||
before_each(function()
|
||||
rawset(vim.fn, 'did_filetype', function() return 1 end)
|
||||
rawset(vim.fn, 'did_filetype', function()
|
||||
return 1
|
||||
end)
|
||||
require('diffs.parser')._test.ft_lang_cache = {}
|
||||
end)
|
||||
|
||||
|
|
|
|||
|
|
@ -392,7 +392,9 @@ describe('parser', function()
|
|||
end)
|
||||
|
||||
it('detects filetype for .sh files when did_filetype() is non-zero', function()
|
||||
rawset(vim.fn, 'did_filetype', function() return 1 end)
|
||||
rawset(vim.fn, 'did_filetype', function()
|
||||
return 1
|
||||
end)
|
||||
|
||||
parser._test.ft_lang_cache = {}
|
||||
local bufnr = create_buffer({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue