File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -290,15 +290,17 @@ local function _init()
290
290
end
291
291
292
292
local function _policy_shuffle ()
293
- local r = math.floor (math.fmod (randint (), # ColorNames ))
294
- local color = ColorNames [r + 1 ]
295
- -- logger.debug(
296
- -- "|colorbox._policy_shuffle| color:%s, ColorNames:%s (%d), r:%d",
297
- -- vim.inspect(color),
298
- -- vim.inspect(ColorNames),
299
- -- vim.inspect()
300
- -- )
301
- vim .cmd (string.format ([[ color %s]] , color ))
293
+ if # ColorNames > 0 then
294
+ local r = math.floor (math.fmod (randint (), # ColorNames ))
295
+ local color = ColorNames [r + 1 ]
296
+ -- logger.debug(
297
+ -- "|colorbox._policy_shuffle| color:%s, ColorNames:%s (%d), r:%d",
298
+ -- vim.inspect(color),
299
+ -- vim.inspect(ColorNames),
300
+ -- vim.inspect()
301
+ -- )
302
+ vim .cmd (string.format ([[ color %s]] , color ))
303
+ end
302
304
end
303
305
304
306
local function _policy ()
You can’t perform that action at this time.
0 commit comments