File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ local M = {}
1111-- Smear cursor color. Defaults to Cursor GUI color if not set.
1212-- Set to "none" to match the text color at the target cursor position.
1313C .cursor_color = nil
14+ C .cursor_color_insert_mode = nil
1415
1516-- Background color. Defaults to Normal GUI background color if not set.
1617C .normal_bg = nil
@@ -45,6 +46,7 @@ C.cterm_bg = 235
4546
4647M .config_variables = {
4748 " cursor_color" ,
49+ " cursor_color_insert_mode" ,
4850 " normal_bg" ,
4951 " transparent_bg_fallback_color" ,
5052 " cterm_cursor_colors" ,
@@ -106,14 +108,14 @@ function M.get_color_at_cursor()
106108end
107109
108110function M .update_color_at_cursor ()
109- if C .cursor_color ~= " none" then return end
111+ if C .cursor_color ~= " none" and C . cursor_color_insert_mode ~= " none " then return end
110112 color_at_cursor = M .get_color_at_cursor ()
111113end
112114
113115--- @param opts ? { level ?: number , inverted ?: boolean }
114116function M .get_hl_group (opts )
115117 opts = opts or {}
116- local _cursor_color = C .cursor_color
118+ local _cursor_color = ( vim . api . nvim_get_mode (). mode == " i " ) and C . cursor_color_insert_mode or C .cursor_color
117119
118120 local hl_group = (" SmearCursor%s%s" ):format (opts .inverted and " Inverted" or " " , tostring (opts .level or " " ))
119121
You can’t perform that action at this time.
0 commit comments