Fix: not setting colorscheme correctly #5

This commit is contained in:
2021-10-08 22:22:56 -03:00
parent e923c165ca
commit 84d3a09092
3 changed files with 13 additions and 13 deletions

View File

@@ -1,8 +1,8 @@
lua << EOF
-- for k in pairs(package.loaded) do
-- if k:match(".*tokyodark.*") then package.loaded[k] = nil end
-- end
EOF
" lua << EOF
" for k in pairs(package.loaded) do
" if k:match(".*tokyodark.*") then package.loaded[k] = nil end
" end
" EOF
lua require('tokyodark')
lua require('tokyodark').colorscheme()

View File

@@ -234,16 +234,14 @@ hl.langs.scala = {
}
function M.clear_namespace()
vim.api.nvim_buf_clear_namespace(0, ns, 0, -1)
set_hl_ns(0)
vim.api.nvim_buf_clear_namespace(0, ns, 0, -1)
set_hl_ns(0)
end
local function load_sync()
load_highlights(hl.predef)
load_highlights(hl.common)
load_highlights(hl.syntax)
-- for _, group in pairs(hl.langs) do load_highlights(ns, group) end
-- for _, group in pairs(hl.plugins) do load_highlights(ns, group) end
set_hl_ns(ns)
end

View File

@@ -1,7 +1,9 @@
local highlights = require('tokyodark.highlights')
local terminal = require('tokyodark.terminal')
local function colorscheme()
local M = {}
function M.colorscheme()
vim.cmd("hi clear")
if vim.fn.exists("syntax_on") then vim.cmd("syntax reset") end
vim.o.background = "dark"
@@ -10,7 +12,7 @@ local function colorscheme()
highlights.setup()
terminal.setup()
vim.cmd [[au ColorSchemePre * lua require("tokyodark.highlights").clear_namespace()]]
vim.cmd [[au ColorSchemePre * lua require("tokyodark.highlights").clear_namespace()]]
end
colorscheme()
return M