Skip to content

Commit

Permalink
fix(picker): properly restore cursor highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
max397574 committed Sep 1, 2022
1 parent 6e2b200 commit ec48f45
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/colortils/tools/picker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ local function create_mappings()
end

return function(color, alpha)
local state={}
local state = {}
state.old_cursor_pos = { 0, 1 }
red, green, blue = color_utils.get_values(color)
buf = vim.api.nvim_create_buf(false, true)
Expand All @@ -520,13 +520,13 @@ return function(color, alpha)
if vim.api.nvim_exec("hi NormalFloat", true):match("NormalFloat%s*xxx%s*cleared") then
vim.api.nvim_set_hl(0, "NormalFloat", { link = "Normal" })
end
local cursor_fg = vim.api.nvim_get_hl_by_name("Cursor", true).foreground
local cursor_bg = vim.api.nvim_get_hl_by_name("Cursor", true).background
vim.api.nvim_set_hl(0, "Cursor", {
fg = vim.api.nvim_get_hl_by_name("NormalFloat", true).background,
bg = vim.api.nvim_get_hl_by_name("NormalFloat", true).background,
})
vim.opt_local.guicursor = "a:ver1-Cursor/Cursor"
local cursor_fg = vim.api.nvim_get_hl_by_name("Cursor", true).foreground
local cursor_bg = vim.api.nvim_get_hl_by_name("Cursor", true).background
vim.api.nvim_create_autocmd("CursorMoved", {
callback = function()
local cursor = vim.api.nvim_win_get_cursor(win)
Expand Down

0 comments on commit ec48f45

Please sign in to comment.