Fix: not setting colorscheme correctly #5
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
lua << EOF
|
" lua << EOF
|
||||||
-- for k in pairs(package.loaded) do
|
" for k in pairs(package.loaded) do
|
||||||
-- if k:match(".*tokyodark.*") then package.loaded[k] = nil end
|
" if k:match(".*tokyodark.*") then package.loaded[k] = nil end
|
||||||
-- end
|
" end
|
||||||
EOF
|
" EOF
|
||||||
|
|
||||||
lua require('tokyodark')
|
lua require('tokyodark').colorscheme()
|
||||||
|
|
||||||
|
|||||||
@@ -234,16 +234,14 @@ hl.langs.scala = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function M.clear_namespace()
|
function M.clear_namespace()
|
||||||
vim.api.nvim_buf_clear_namespace(0, ns, 0, -1)
|
vim.api.nvim_buf_clear_namespace(0, ns, 0, -1)
|
||||||
set_hl_ns(0)
|
set_hl_ns(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function load_sync()
|
local function load_sync()
|
||||||
load_highlights(hl.predef)
|
load_highlights(hl.predef)
|
||||||
load_highlights(hl.common)
|
load_highlights(hl.common)
|
||||||
load_highlights(hl.syntax)
|
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)
|
set_hl_ns(ns)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
local highlights = require('tokyodark.highlights')
|
local highlights = require('tokyodark.highlights')
|
||||||
local terminal = require('tokyodark.terminal')
|
local terminal = require('tokyodark.terminal')
|
||||||
|
|
||||||
local function colorscheme()
|
local M = {}
|
||||||
|
|
||||||
|
function M.colorscheme()
|
||||||
vim.cmd("hi clear")
|
vim.cmd("hi clear")
|
||||||
if vim.fn.exists("syntax_on") then vim.cmd("syntax reset") end
|
if vim.fn.exists("syntax_on") then vim.cmd("syntax reset") end
|
||||||
vim.o.background = "dark"
|
vim.o.background = "dark"
|
||||||
@@ -10,7 +12,7 @@ local function colorscheme()
|
|||||||
highlights.setup()
|
highlights.setup()
|
||||||
terminal.setup()
|
terminal.setup()
|
||||||
|
|
||||||
vim.cmd [[au ColorSchemePre * lua require("tokyodark.highlights").clear_namespace()]]
|
vim.cmd [[au ColorSchemePre * lua require("tokyodark.highlights").clear_namespace()]]
|
||||||
end
|
end
|
||||||
|
|
||||||
colorscheme()
|
return M
|
||||||
|
|||||||
Reference in New Issue
Block a user