Skip to content

Commit

Permalink
fix: remove vim.prints, use vim.notify_once
Browse files Browse the repository at this point in the history
fixes #54
  • Loading branch information
willothy committed Dec 28, 2023
1 parent 0409b73 commit 72f102d
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions lua/hawtkeys/ts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ end
---@param dir string
---@return table
local function find_files(dir)
print("Scanning dir" .. dir)
-- print("Scanning dir" .. dir)
local dirScan = dir or vim.fn.stdpath("config")
local files = scan.scan_dir(dirScan, { hidden = true })
return files
Expand All @@ -124,7 +124,7 @@ end
---@return table
local function find_maps_in_file(filePath)
if scannedFiles[filePath] then
print("Already scanned")
-- already scanned
return {}
end
scannedFiles[filePath] = true
Expand Down Expand Up @@ -298,7 +298,7 @@ local function find_maps_in_file(filePath)
.get_node_text(child, fileContent)
:gsub("['\"]", "")
:gsub("[\n\r]", "")
vim.print("type: " .. vim.inspect(ty))
-- vim.print("type: " .. vim.inspect(ty))
table.insert(modes, ty)
end
end
Expand All @@ -322,8 +322,9 @@ local function find_maps_in_file(filePath)
return require("which-key.mappings")
end)
if not wkLoaded then
vim.print(
"Which Key Mappings require which-key to be installed"
vim.notify_once(
"Which Key Mappings require which-key to be installed",
vim.log.levels.WARN
)
break
end
Expand All @@ -333,7 +334,10 @@ local function find_maps_in_file(filePath)
return loadstring("return " .. strObj)()
end)
if not ok then
vim.print("Error parsing which-key table")
vim.notify_once(
"Error parsing which-key table",
vim.log.levels.ERROR
)
break
end
local wkMapping = which_key.parse(tableObj)
Expand Down Expand Up @@ -363,7 +367,10 @@ local function get_keymaps_from_lazy()
return require("lazy").plugins()
end)
if not ok then
vim.print("Lazy Loading requires Lazy")
vim.notify_once(
"Lazy Loading requires Lazy",
vim.log.levels.INFO
)
break
end
for _, v in ipairs(lazy) do
Expand Down

0 comments on commit 72f102d

Please sign in to comment.