Skip to content

Commit

Permalink
fix: define highlights on color scheme event
Browse files Browse the repository at this point in the history
See #91
  • Loading branch information
rcarriga committed Aug 21, 2022
1 parent 0ba2cb5 commit 8e4c848
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion lua/neotest/config/init.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---@tag neotest.config

vim.cmd([[
local function define_highlights()
vim.cmd([[
hi default NeotestPassed ctermfg=Green guifg=#96F291
hi default NeotestFailed ctermfg=Red guifg=#F70067
hi default NeotestRunning ctermfg=Yellow guifg=#FFEC63
Expand All @@ -18,7 +19,11 @@ vim.cmd([[
hi default NeotestTarget ctermfg=Red guifg=#F70067
hi default link NeotestUnknown Normal
]])
end

local augroup = vim.api.nvim_create_augroup("NeotestColorSchemeRefresh", {})
vim.api.nvim_create_autocmd("ColorScheme", { callback = define_highlights, group = augroup })
define_highlights()
---@class neotest.Config
---@field adapters neotest.Adapter[]
---@field consumers table<string, neotest.Consumer>
Expand Down
4 changes: 2 additions & 2 deletions lua/neotest/consumers/summary/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ local function create_buf()
end

summary_buf = async.api.nvim_create_buf(false, true)
async.api.nvim_buf_set_option(summary_buf, 'modifiable', false)
async.api.nvim_buf_set_option(summary_buf, "modifiable", false)
async.api.nvim_buf_set_name(summary_buf, buf_name)
return summary_buf
end
Expand All @@ -31,7 +31,7 @@ local function open_window(buf)
local win = async.api.nvim_get_current_win()
async.api.nvim_win_set_buf(win, buf)
async.api.nvim_set_current_win(cur_win)
async.api.nvim_buf_set_option(summary_buf, 'filetype', 'neotest-summary')
async.api.nvim_buf_set_option(summary_buf, "filetype", "neotest-summary")
end

local components = {}
Expand Down

0 comments on commit 8e4c848

Please sign in to comment.