@@ -5,6 +5,29 @@ local statuscolumn = {};
5
5
--- @type string
6
6
local STC = " %!v:lua.require('bars.statuscolumn').render()" ;
7
7
8
+ local gradient_map = {
9
+ default = " BarsNormal%d" ,
10
+
11
+ [" v" ] = " BarsVisual%d" ,
12
+ [" V" ] = " BarsVisualLine%d" ,
13
+ [" " ] = " BarsVisualBlock%d" ,
14
+
15
+ [" s" ] = " BarsVisual%d" ,
16
+ [" S" ] = " BarsVisualLine%d" ,
17
+ [" " ] = " BarsVisualBlock%d" ,
18
+
19
+ [" i" ] = " BarsInsert%d" ,
20
+ [" ic" ] = " BarsInsert%d" ,
21
+ [" ix" ] = " BarsInsert%d" ,
22
+
23
+ [" R" ] = " BarsInsert%d" ,
24
+ [" Rc" ] = " BarsInsert%d" ,
25
+
26
+ [" c" ] = " BarsCommand%d" ,
27
+ [" !" ] = " BarsCommand%d" ,
28
+ };
29
+
30
+
8
31
--- @type statuscolumn.config
9
32
statuscolumn .config = {
10
33
ignore_filetypes = { " blink-cmp-menu" },
@@ -114,50 +137,31 @@ statuscolumn.config = {
114
137
virt_hl = {
115
138
" BarsVirtual1" , " BarsVirtual2" , " BarsVirtual3" , " BarsVirtual4" , " BarsVirtual5" ,
116
139
},
117
- hl = {
118
- " BarsLineNr" ,
119
- " LineNr" ,
120
- }
140
+ hl = function ()
141
+ --- @type string
142
+ local mode = vim .api .nvim_get_mode ().mode ;
143
+ local USE = gradient_map [mode ] or gradient_map .default
144
+
145
+ return {
146
+ string.format (USE , 1 ),
147
+ " LineNr" ,
148
+ };
149
+ end ,
121
150
},
122
151
{
123
152
kind = " border" ,
124
153
text = " ▕" ,
125
- hl = function (_ , window )
126
- --- | fS " Color matching the mode"
127
-
154
+ hl = function ()
128
155
local _o = {};
129
- local gr_map = {
130
- default = " BarsNormal%d" ,
131
-
132
- [" v" ] = " BarsVisual%d" ,
133
- [" V" ] = " BarsVisualLine%d" ,
134
- [" " ] = " BarsVisualBlock%d" ,
135
-
136
- [" s" ] = " BarsVisual%d" ,
137
- [" S" ] = " BarsVisualLine%d" ,
138
- [" " ] = " BarsVisualBlock%d" ,
139
-
140
- [" i" ] = " BarsInsert%d" ,
141
- [" ic" ] = " BarsInsert%d" ,
142
- [" ix" ] = " BarsInsert%d" ,
143
-
144
- [" R" ] = " BarsInsert%d" ,
145
- [" Rc" ] = " BarsInsert%d" ,
146
-
147
- [" c" ] = " BarsCommand%d" ,
148
- [" !" ] = " BarsCommand%d" ,
149
- };
150
-
151
156
--- @type string
152
157
local mode = vim .api .nvim_get_mode ().mode ;
153
- local USE = gr_map [mode ] or gr_map .default
158
+ local USE = gradient_map [mode ] or gradient_map .default
154
159
155
160
for g = 1 , 7 do
156
161
table.insert (_o , string.format (USE , g ));
157
162
end
158
163
159
164
return _o ;
160
- --- | fE
161
165
end
162
166
},
163
167
{
@@ -393,6 +397,4 @@ statuscolumn.setup = function (config)
393
397
--- | fE
394
398
end
395
399
396
- local times = {};
397
-
398
400
return statuscolumn ;
0 commit comments