A more modern way to raise warning message (#893)

This commit is contained in:
Yuriy Artemyev
2022-01-21 13:07:47 +03:00
committed by GitHub
parent fa8bb09de4
commit e725572f2a

View File

@@ -1,15 +1,14 @@
local M = {}
local uv = vim.loop
local api = vim.api
function M.path_to_matching_str(path)
return path:gsub('(%-)', '(%%-)'):gsub('(%.)', '(%%.)'):gsub('(%_)', '(%%_)')
end
function M.warn(msg)
api.nvim_command('echohl WarningMsg')
api.nvim_command("echom '[NvimTree] "..msg:gsub("'", "''").."'")
api.nvim_command('echohl None')
vim.schedule(function()
vim.notify("[NvimTree] "..msg, vim.log.levels.WARN)
end)
end
function M.str_find(haystack, needle)