fix: try reducing some bugs
This commit is contained in:
@ -7,7 +7,6 @@ function string:width()
|
||||
return vim.fn.strdisplaywidth(self)
|
||||
end
|
||||
|
||||
|
||||
local s_to_b = true -- 从小到大排列
|
||||
|
||||
local m_win_width -- 需要被格式化窗口的高度
|
||||
|
@ -43,16 +43,21 @@ end
|
||||
-- curl --data {{'{"name":"bob"}'}} --header {{'Content-Type: application/json'}} {{http://example.com/users/1234}}
|
||||
|
||||
local function query_word(q)
|
||||
local field = (
|
||||
[[curl -s --header 'Content-Type: application/x-www-form-urlencoded' https://openapi.youdao.com/api]])
|
||||
for k, v in pairs(q) do
|
||||
field = field .. ([[ -d '%s=%s']]):format(k, v)
|
||||
local ok, curl = pcall(require, 'plenary.curl')
|
||||
if ok then
|
||||
-- TODO
|
||||
else
|
||||
local field = (
|
||||
[[curl -s --header 'Content-Type: application/x-www-form-urlencoded' https://openapi.youdao.com/api]])
|
||||
|
||||
for k, v in pairs(q) do
|
||||
field = field .. ([[ -d '%s=%s']]):format(k, v)
|
||||
end
|
||||
|
||||
local output = vim.fn.system(field)
|
||||
local tb = vim.fn.json_decode(output)
|
||||
return tb
|
||||
end
|
||||
-- vim.pretty_print(field)
|
||||
local output = vim.fn.system(field)
|
||||
local tb = vim.fn.json_decode(output)
|
||||
-- print(type(output))
|
||||
-- vim.pretty_print(tb.basic)
|
||||
end
|
||||
|
||||
M.test = function(query)
|
||||
|
@ -5,4 +5,14 @@ local a = {
|
||||
}
|
||||
|
||||
|
||||
print(a, b)
|
||||
local function test(tmp)
|
||||
tmp = {
|
||||
'bbbbbb'
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
test(a)
|
||||
for i, v in ipairs(a) do
|
||||
print(v)
|
||||
end
|
||||
|
Reference in New Issue
Block a user