Skip to content

Commit

Permalink
fix(linting warnings): Luacheck passing 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeioth committed Sep 1, 2023
1 parent b0276ae commit 2c8e4d7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
12 changes: 3 additions & 9 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
-- Global objects
globals = {
"PACKER_BOOTSTRAP",
"base",
"vim",
"bit",
"C",
"packer_plugins",
"_G",
"utils",
}

-- Rerun tests only if their modification time changed
Expand All @@ -14,7 +11,4 @@ cache = true
-- Don't report unused self arguments of methods
self = false

ignore = {
"631", -- max_line_length
"212/_.*", -- unused argument, for vars with "_" prefix
}
max_line_length = 150
1 change: 0 additions & 1 deletion .styluaignore

This file was deleted.

14 changes: 7 additions & 7 deletions lua/markmap/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ local M = {}

M.setup = function(ctx)
-- Setup options
html_output = ctx.html_output
hide_toolbar = ctx.hide_toolbar
grace_period = ctx.grace_period
local html_output = ctx.html_output
local hide_toolbar = ctx.hide_toolbar
local grace_period = ctx.grace_period

-- Set default options
if html_output == nil then
Expand All @@ -33,10 +33,10 @@ M.setup = function(ctx)

-- Set a common job for all commands.
-- This prevents more than one job running at the same time.
job = nil
local job = nil

-- Set common arguments to avoid code repetition.
arguments = {}
local arguments = {}
if html_output ~= "" then -- if html_output is "", don't pass the parameter
table.insert(arguments, "-o")
table.insert(arguments, html_output)
Expand Down Expand Up @@ -72,7 +72,7 @@ M.setup = function(ctx)

-- Autocmds --------------------------------------------------------------
-- Kill jobs after a grace period
last_execution = uv.now() -- timer for grace period
local last_execution = uv.now() -- timer for grace period
autocmd("CursorHold", {
desc = "Kill all markmap jobs after a grace period",
group = augroup("markmap_kill_after_grace_period", { clear = true }),
Expand All @@ -84,7 +84,7 @@ M.setup = function(ctx)
end

-- Otherwise, use grace_period
current_time = uv.now()
local current_time = uv.now()
if current_time - last_execution >= grace_period then -- if grace period exceeded
if job ~= nil then uv.process_kill(job, 9) end -- pkill -9 jobs
last_execution = current_time -- update time
Expand Down

0 comments on commit 2c8e4d7

Please sign in to comment.