A more modern way to raise warning message (#893)
This commit is contained in:
@@ -1,15 +1,14 @@
|
|||||||
local M = {}
|
local M = {}
|
||||||
local uv = vim.loop
|
local uv = vim.loop
|
||||||
local api = vim.api
|
|
||||||
|
|
||||||
function M.path_to_matching_str(path)
|
function M.path_to_matching_str(path)
|
||||||
return path:gsub('(%-)', '(%%-)'):gsub('(%.)', '(%%.)'):gsub('(%_)', '(%%_)')
|
return path:gsub('(%-)', '(%%-)'):gsub('(%.)', '(%%.)'):gsub('(%_)', '(%%_)')
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.warn(msg)
|
function M.warn(msg)
|
||||||
api.nvim_command('echohl WarningMsg')
|
vim.schedule(function()
|
||||||
api.nvim_command("echom '[NvimTree] "..msg:gsub("'", "''").."'")
|
vim.notify("[NvimTree] "..msg, vim.log.levels.WARN)
|
||||||
api.nvim_command('echohl None')
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.str_find(haystack, needle)
|
function M.str_find(haystack, needle)
|
||||||
|
|||||||
Reference in New Issue
Block a user