-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from hkupty/drop-deprecated
Remove deprecated functions
- Loading branch information
Showing
5 changed files
with
147 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,23 @@ | ||
local fns = {} | ||
|
||
fns.prompt = function(message) | ||
vim.fn.inputsave() | ||
local ret = vim.fn.input(message) | ||
vim.fn.inputrestore() | ||
return ret | ||
local function capitalize_first(s) | ||
return string.upper(string.sub(s,1,1))..string.sub(s,2) | ||
end | ||
|
||
fns.split = function(str) | ||
local p = {} | ||
for i=1, #str do | ||
table.insert(p, str:sub(i, i)) | ||
end | ||
return p | ||
fns.snake_to_pascal = function(s) | ||
return (string.gsub(capitalize_first(s),"_(%w+)",capitalize_first)) | ||
end | ||
|
||
fns.build_cmd = function(options) | ||
local nargs = options.nargs or 0 | ||
local cmd = options.cmd or options.lazy_cmd() | ||
|
||
vim.cmd('command! -nargs=' .. nargs .. ' ' .. options.name .. ' ' .. cmd) | ||
fns.fn_or_command = function(cmd) | ||
local tp = type(cmd) | ||
if tp == "function" then | ||
cmd() | ||
elseif tp == "string" then | ||
vim.cmd(cmd) | ||
else | ||
print("nvimux: Cannot run command of type " .. tp) | ||
end | ||
end | ||
|
||
|
||
return fns |
Oops, something went wrong.