style: code format use lua_ls

This commit is contained in:
JuanZoran
2023-03-24 00:56:36 +08:00
parent 9f5a81249c
commit 82fa2a008a
22 changed files with 227 additions and 247 deletions

View File

@@ -1,16 +0,0 @@
local M = {}
M.test_api_latency = function(urls)
urls = type(urls) == 'string' and { urls } or urls
local f = [[curl -s -o /dev/null -w '[%s]延迟: %%{time_total}s %s']]
local result = {}
for _, url in ipairs(urls) do
local cmd = string.format(f, url, url)
local res = vim.fn.system(cmd)
result[#result + 1] = res
end
vim.pretty_print(result)
end
return M

View File

@@ -1,4 +1,4 @@
local util = require('Trans').util
local util = require 'Trans'.util
---@class TransNode
---@field [1] string text to be rendered
@@ -29,7 +29,7 @@ local text_meta = {
render = function(self, buffer, line, col)
local nodes = self.nodes
local step = self.step
local len = step and #step or 0
local len = step and #step or 0
for _, node in ipairs(nodes) do
node:render(buffer, line, col)
@@ -66,7 +66,7 @@ end
---@return TransText
local function format(args)
local width = args.width
local spin = args.spin or " "
local spin = args.spin or ' '
local size = #args
local wid = 0
for i = 1, size do
@@ -93,9 +93,9 @@ return {
format = format,
conjunction = function(str)
return {
item { "", "TransTitleRound" },
item { str, "TransTitle" },
item { "", "TransTitleRound" },
item { '', 'TransTitleRound' },
item { str, 'TransTitle' },
item { '', 'TransTitleRound' },
}
end,
}