Improve API stability

This commit is contained in:
hrsh7th
2021-08-24 22:43:02 +09:00
parent cbb80af6dd
commit c0fcdd9c61
5 changed files with 165 additions and 119 deletions

View File

@@ -136,4 +136,16 @@ misc.to_vimindex = function(text, utfindex)
return utfindex + 1
end
---Mark the function as deprecated
misc.deprecated = function(fn, msg)
local printed = false
return function(...)
if not printed then
print(msg)
printed = true
end
return fn(...)
end
end
return misc